T
TanStack2mo ago
molecular-blue

[plugin:vite:import-analysis] Failed to resolve import "tanstack-start-injected-head-scripts:v" from

How to debug this one
No description
10 Replies
sunny-green
sunny-green2mo ago
I have the same issue ..
✗ 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)
at file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33898:73
at onwarn (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/@vitejs/plugin-react/dist/index.js:55:7)
at file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33898:28
at onRollupLog (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33893:63)
at onLog (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33696:4)
at file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/rollup/dist/es/shared/node-entry.js:20937:32
at Object.logger [as onLog] (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/rollup/dist/es/shared/node-entry.js:22823:9)
at ModuleLoader.handleInvalidResolvedId (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/rollup/dist/es/shared/node-entry.js:21567:26)
at ModuleLoader.resolveDynamicImport (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/rollup/dist/es/shared/node-entry.js:21625:58)
✗ 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)
at file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33898:73
at onwarn (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/@vitejs/plugin-react/dist/index.js:55:7)
at file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33898:28
at onRollupLog (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33893:63)
at onLog (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/vite/dist/node/chunks/dep-B0GuR2De.js:33696:4)
at file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/rollup/dist/es/shared/node-entry.js:20937:32
at Object.logger [as onLog] (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/rollup/dist/es/shared/node-entry.js:22823:9)
at ModuleLoader.handleInvalidResolvedId (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/rollup/dist/es/shared/node-entry.js:21567:26)
at ModuleLoader.resolveDynamicImport (file:///Users/franciszekstodulski/Dev/@others/wizytka/node_modules/rollup/dist/es/shared/node-entry.js:21625:58)
` But mine is on build
quickest-silver
quickest-silver2mo ago
what vite version are you using? and node version
sunny-green
sunny-green2mo ago
"vite": "^7.1.10", v24.4.1
quickest-silver
quickest-silver2mo ago
Welp I don't have anything else then. I had that once and updating my node version fixed it
multiple-amethyst
multiple-amethyst2mo ago
Getting the same error, but only when trying to use a 3rd party i18n library+plugin
absent-sapphire
absent-sapphire2mo ago
AS I know this error happens when you are importing some server functions on client +> https://github.com/TanStack/router/issues/5196
GitHub
v1.132.2 Rollup failed to resolve import "tanstack-start-injected-h...
Which project does this relate to? Start Describe the bug Error during build on version 1.132.2. error during build: [vite]: Rollup failed to resolve import "tanstack-start-injected-head-scrip...
absent-sapphire
absent-sapphire2mo ago
Issue to improve the error message in that case => https://github.com/TanStack/router/issues/5469
GitHub
Improve start error message when importing server code on the clien...
Which project does this relate to? Start Describe the bug When someone imports server code on the client in the current iteration of tanstack start, vite gives a very hard-to-debug error which does...
plain-purple
plain-purple2mo ago
I am having the same issue on npm run build, is this a bug ?
broad-brown
broad-brown2mo ago
same

Did you find this page helpful?