framework icon indicating copy to clipboard operation
framework copied to clipboard

Deep dependency conflict on output of build

Open zendagin opened this issue 2 years ago • 3 comments

Environment


  • Operating System: Windows_NT
  • Node Version: v14.17.5
  • Nuxt Version: 3.0.0-rc.1-27510703.46ecbc5
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/dicky1126277766238/nuxt3-dependency-bug-reproduction

Describe the bug

When building with firestore and mongodb sdk, a deep dependency conflict of whatwg-url version ^5.0.0 and ^11.0.0 occurs. yarn dev functioned normally but if I deploy to netlify or try with yarn build then yarn start, it crashed because URL.searchParams is undefined, which means it is using the ^5.0.0 one on somewhere it expected to be ^11.0.0.

After checking the output, I found that ^5.0.0 is packed.

Additional context

I found that sometimes it shows the following message on other packages

[warn] Multiple major versions of package xxx are being externalized. Picking latest version.

So it seems that theoretically it suppose to pick the latest one? But it is not the case this time.

Logs

No response

zendagin avatar Apr 25 '22 08:04 zendagin

cc: @pi0

danielroe avatar May 11 '22 22:05 danielroe

@dicky1126277766238 have you found workaround? For larger projects it's quite easy to face this issue.

dargmuesli avatar Jul 13 '22 08:07 dargmuesli

@dargmuesli I am using a temporary fix that force the package to be always resolved as the newer version with npm overrides since 8.3 or yarn resolutions. However it may cause error if the package is not backward compatible.

zendagin avatar Aug 03 '22 10:08 zendagin

This should be resolved in nitropack v0.5.4. which you can get with yarn upgrade nuxt or npm upgrade nuxt.

Let me know if not and I'll reopen.

danielroe avatar Sep 20 '22 10:09 danielroe