framework
framework copied to clipboard
Deep dependency conflict on output of build
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
cc: @pi0
@dicky1126277766238 have you found workaround? For larger projects it's quite easy to face this issue.
@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.
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.