#[Build] tanstack-start-injected-head-scriptRollup failed to resolve import "tanstack-start-injected-

36 messages · Page 1 of 1 (latest)

tawdry iris
#

Trying to build my project.
Getting;

✗ Build failed in 1.72s
error during build:
[vite]: Rollup failed to resolve import "tanstack-start-injected-head-scripts:v" from "/Users/franciszekstodulski/Dev/@others/wizytka/node_modules/@tanstack/start-server-core/dist/esm/loadVirtualModule.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at viteLog (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33864:57)
.........

No idea what cause that..
Using orpc, using getRequestHeaders in my server functions..
no idea.

north pine
#

Same issue, how did you fix it?

loud glade
#

that's how i fixed it at least

tawdry iris
#

That was my idea too. But my app was too big. Just switched to next. I will use tan stack when it’s more stable

north pine
#

I am not importing getRequestHeaders anywhere in my app, what can be the issue?

dawn mantle
#

I know this issue happens if you try to call "getRequestHeaders()" in a beforeLoad for example

#

i assume it can happen with any function in @tanstack/react-start/server

#

and i think it's logic cause those functions should be called only in server functions ?
that's the issue ?

dawn mantle
#

@tawdry iris

tawdry iris
#

Already migrated back to nextjs

dawn mantle
tawdry iris
#

I spend 3 days on it. No idea where the issue was. I got different build issues - even on clean fresh projects - from TStack and Better Stack - even examples… will be back on it when it’s ready - is super dope project - definitely will use it someday

wintry junco
minor dome
minor dome
dawn mantle
#

that's how i do it

#

and then i use this function with tanstack query

minor dome
#

ah i see. so my first usage is causing issue. i should refer to the orpc doc's createIsomorphicFn usage

#

thanks! i'll try change that

faint notch
minor dome
dawn mantle
dawn mantle
minor dome
#

thank you so much!!!!

dawn mantle
#

nice !

minor dome
#

there are still some other issues though. but this error is gone! i'll continue the migration 😄

#

❤️

faint notch
#

👋

tawdry iris
#

Hey @dawn mantle How do you use it in your components?

dawn mantle