qwik
qwik copied to clipboard
Rollup failed to resolve import "@qwik-city-not-found-paths" during `npm run preview`
Qwik Version
0.13.3
Operating System (or Browser)
Ubuntu 20.04 LTS
Node Version (if applicable)
v18.12.1
Which component is affected?
Qwik Rollup / Vite plugin
Expected Behaviour
npm run preview works without errors
Actual Behaviour
Building client modules in npm run preview fails with the following error:
✓ Built client modules
[vite]: Rollup failed to resolve import "@qwik-city-not-found-paths" from "node_modules/@builder.io/qwik-city/middleware/node/index.mjs".
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`
error during build:
Error: [vite]: Rollup failed to resolve import "@qwik-city-not-found-paths" from "node_modules/@builder.io/qwik-city/middleware/node/index.mjs".
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 onRollupWarning (file:///home/voreny/projects/wedding-site/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:45526:19)
at onwarn (file:///home/voreny/projects/wedding-site/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:45297:13)
at Object.onwarn (file:///home/voreny/projects/wedding-site/node_modules/rollup/dist/es/shared/rollup.js:23263:13)
at ModuleLoader.handleResolveId (file:///home/voreny/projects/wedding-site/node_modules/rollup/dist/es/shared/rollup.js:22158:26)
at file:///home/voreny/projects/wedding-site/node_modules/rollup/dist/es/shared/rollup.js:22119:26
Additional Information
I just upgraded to
"@builder.io/qwik": "0.13.3",
"@builder.io/qwik-city": "0.0.123",
and got this issue. npm run build and npm run dev work fine. I don't have any adaptors installed.
My vite.config.ts is the default one:
import { defineConfig } from "vite";
import { qwikVite } from "@builder.io/qwik/optimizer";
import { qwikCity } from "@builder.io/qwik-city/vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig(() => {
return {
plugins: [qwikCity(), qwikVite(), tsconfigPaths()],
};
});
Same error, happens with a fresh install of qwik and immediately upgrading qwik-city.
- npm create qwik@latest (qwik city app)
- npm install -D @builder.io/qwik-city@latest
- npm run preview
"@builder.io/qwik": "0.13.3",
"@builder.io/qwik-city": "0.0.123",
I had the same issue and resolved it by downgrading qwik-city to 0.0.122
If you are in a local environment, you can add the following options to make it work.
build: {
rollupOptions: {
external: ["@qwik-city-not-found-paths", "@qwik-city-static-paths"],
},
},
Should be fixed in with!
"@builder.io/qwik": "0.14.0",
"@builder.io/qwik-city": "0.0.125",
Thanks for the issue!!
Thanks for the fix, I've just upgraded and it seems to work well now :ok_hand: