Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐞] error during build: RollupError: Duplicate export 's_DyVc0YBIqQU' #4768

Open
maiieul opened this issue Jul 10, 2023 · 6 comments
Open
Labels
COMP: DX Developer Experience related issue TYPE: bug Something isn't working

Comments

@maiieul
Copy link
Contributor

maiieul commented Jul 10, 2023

Which component is affected?

Qwik Rollup / Vite plugin

Describe the bug

I accidentally added a dependency (@builder.io/qwik-react) both in devDependencies and dependencies 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

  1. Run npm create qwik@latest
  2. Select 'Basic App' starter
  3. Manually add "@builder.io/qwik-city": "^1.2.6" to 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.
  4. cd into project
  5. run npm install
  6. run npm run preview

The bug can be reproduced with npm and pnpm as well. I haven't tried it out with yarn.

System Info

System:
    OS: Linux 6.3 Fedora Linux 38 (Workstation Edition)
    CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-1340P
    Memory: 21.87 GB / 31.05 GB
    Container: Yes
    Shell: 3.6.1 - /usr/bin/fish
  Binaries:
    Node: 18.16.1 - /usr/local/bin/node
    npm: 9.7.2 - /usr/local/bin/npm
    pnpm: 8.6.7 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 114.0.5735.198

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 and devDependencies in package.json." may be helpful.

@maiieul maiieul added TYPE: bug Something isn't working STATUS-1: needs triage New issue which needs to be triaged labels Jul 10, 2023
@maiieul
Copy link
Contributor Author

maiieul commented Jul 11, 2023

@og-dev
Copy link

og-dev commented Dec 30, 2023

Same error here.
Any update about this issue?

@maiieul
Copy link
Contributor Author

maiieul commented Dec 30, 2023

@og-dev Are you having this error for the same reason?

@gioboa
Copy link
Member

gioboa commented Dec 30, 2023

In this PR we have the same issue during the production build 😔😢

@maiieul
Copy link
Contributor Author

maiieul commented Dec 31, 2023

@gioboa @the-r3aper7 That might be related to #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. qwikifiers/qwik-ui#519). Shai thought #5473 could be fixed quickly but that might still take another few months..

@maiieul maiieul added COMP: DX Developer Experience related issue P1: nice to have / fix and removed STATUS-1: needs triage New issue which needs to be triaged labels Jun 18, 2024
@maiieul
Copy link
Contributor Author

maiieul commented Aug 17, 2024

@gioboa I believe new starter projects include a piece of code preventing from running into this issue. But still would prefer having a proper error message for it so I keep this open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP: DX Developer Experience related issue TYPE: bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants