Open maiieul opened 1 year ago
P.S. The error seems to be thrown from qwikloader.ts: https://github.com/BuilderIO/qwik/blob/190f0bcd7593745b58aef07054547551253d087b/packages/qwik/src/qwikloader.ts#L85
Same error here. Any update about this issue?
@og-dev Are you having this error for the same reason?
In this PR we have the same issue during the production build ππ’
@gioboa @the-r3aper7 That might be related to https://github.com/BuilderIO/qwik/issues/5473
You could try linking qwik-ui in the PR branch and removing preserveModules, then build, to see if it works.
I'm in the process of cleaning-up qwik-ui's codebase, and I'll submit another PR to remove preserveModules
since it's kind of a performance hack that introduces bugs (e.g. https://github.com/qwikifiers/qwik-ui/issues/519). Shai thought #5473 could be fixed quickly but that might still take another few months..
Which component is affected?
Qwik Rollup / Vite plugin
Describe the bug
I accidentally added a dependency (@builder.io/qwik-react) both in
devDependencies
anddependencies
to my package.json file, and got this obscure error message with no qwik way to know what's happening when building it for production.This seems to happen not just for this package but for some others as well. For example, I tried with @builder.io/qwik-city and got the same error. But with @builder.io/qwik it doesn't throw anything.
I don't know if this can be fixed and I guess it's actually good to have an error message when there is a duplicate entry like that, but the current error message says "duplicate export", which led me to think that I had written two
export
statements somewhere in my code.Reproduction
npm create qwik@latest
Steps to reproduce
npm create qwik@latest
dependencies
in package.json (I don't know how I ended up doing this, but I did. It was accidental.). This is the critical step to reproduce this issue. You need to have "@builder.io/qwik-city": "^1.2.6" in devDependencies and in dependencies.cd
into projectnpm install
npm run preview
The bug can be reproduced with npm and pnpm as well. I haven't tried it out with yarn.
System Info
Potential solutions
I think an added error message suggesting something like "You may run into this error because you have a duplicate entry in
dependencies
anddevDependencies
in package.json." may be helpful.