question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

externalized packages aren't traced properly

See original GitHub issue

Environment

  • Operating System: Linux
  • Node Version: v18.7.0
  • Nitro: latest

Reproduction

https://github.com/mahdiboomeri/nitro-externalized-issue

my older reproduction for context: https://github.com/mahdiboomeri/nuxt3-externalized-issue

Describe the bug

related to https://github.com/nuxt/framework/issues/7105 and #515

When using packages with the same dependency but conflicting versions, the externalized dependency files aren’t traced properly. (sorry if it’s a bit unclear this was the best way i could explain it) for example in the reproduction repo i’m using sharp and jsonwebtoken which both rely on different versions of semver.

I get the following file structure in .output/server/node_modules/semver

- πŸ“‚ semver
   - πŸ“‚ classes
     - πŸ“„ semver.js
   - πŸ“‚ functions
     - πŸ“„ coerce.js
     - πŸ“„ compare.js
     - πŸ“„ gte.js
     - πŸ“„ parse.js
   - πŸ“‚ internal
     - πŸ“„ constants.js
     - πŸ“„ debug.js
     - πŸ“„ identifiers.js
     - πŸ“„ parse\-options.js
     - πŸ“„ re.js
   - πŸ“„ package.json

What it should be

- πŸ“‚ semver
   - πŸ“‚ classes
     - πŸ“„ comparator.js
     - πŸ“„ range.js
     - πŸ“„ semver.js
   - πŸ“‚ functions
     - πŸ“„ clean.js
     - πŸ“„ cmp.js
     - πŸ“„ coerce.js
     - πŸ“„ compare\-build.js
     - πŸ“„ compare\-loose.js
     - πŸ“„ compare.js
     - πŸ“„ diff.js
     - πŸ“„ eq.js
     - πŸ“„ gt.js
     - πŸ“„ gte.js
     - πŸ“„ inc.js
     - πŸ“„ lt.js
     - πŸ“„ lte.js
     - πŸ“„ major.js
     - πŸ“„ minor.js
     - πŸ“„ neq.js
     - πŸ“„ parse.js
     - πŸ“„ patch.js
     - πŸ“„ prerelease.js
     - πŸ“„ rcompare.js
     - πŸ“„ rsort.js
     - πŸ“„ satisfies.js
     - πŸ“„ sort.js
     - πŸ“„ valid.js
   - πŸ“‚ internal
     - πŸ“„ constants.js
     - πŸ“„ debug.js
     - πŸ“„ identifiers.js
     - πŸ“„ parse\-options.js
     - πŸ“„ re.js
   - πŸ“‚ ranges
     - πŸ“„ gtr.js
     - πŸ“„ intersects.js
     - πŸ“„ ltr.js
     - πŸ“„ max\-satisfying.js
     - πŸ“„ min\-satisfying.js
     - πŸ“„ min\-version.js
     - πŸ“„ outside.js
     - πŸ“„ simplify.js
     - πŸ“„ subset.js
     - πŸ“„ to\-comparators.js
     - πŸ“„ valid.js
   - πŸ“„ index.js
   - πŸ“„ package.json
   - πŸ“„ preload.js  

I understand the issue isn’t related to these specific packages, you can find more examples in the https://github.com/nuxt/framework/issues/7105 comments

Additional context

This was partially fixed in #515 but the problem is still there

Logs

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mahdiboomericommented, Dec 15, 2022

hi @itpropro Thanks for the further explanation, Based on what you described I think you’re right. I didn’t have much context on #612 other than the reproduction that’s why they sounded different to me i mananged to find some success in fixing the issue with just hacking around, i’m working on a better fix, if it works I probably make a PR

0reactions
itproprocommented, Dec 14, 2022

Hi @mahdiboomeri, I think it’s actually the same issue. The behavior you describe is exactly the same I experienced with e.g. the @azure/identity package. It happens after the build and Nitro throws multiple warning about different versions and that it is picking the newest one. #612 should also be fixed, if all packages are considered for the bundle if they are referenced by a package or a dependency.

EDIT: Here is a updated screenshot from #612 from one of my projects that still throws the warnings with the current nitropack-edge version. I hope we find a fix for this soon πŸ™Œ

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mocha AE Error: "One or more layers were not tracked properly."
I keep getting an error when trying to track my mask, I've tried increasing the minimum percentage of pixels used as suggested but...
Read more >
Duplicate exports via export * which map to the same ... - GitHub
Well specifically, duplicated external exports. If the library is not externalized, then esbuild handles it correctly.
Read more >
How to externalize TikZ pictures - TeX - LaTeX Stack Exchange
This gives you full control and does not require any shell escape huzzle. Put every TikZ image in a file of its own...
Read more >
Externalizing parameters using SAP Cloud Platform ...
This is possible by creating or reusing more than one parameter in the parameter column and use the combination of tokens in the...
Read more >
Amazon Logistics - Global Package Tracking
After an order has shipped, you can track your packages on Amazon.com. ... Unfortunately, Amazon does not allow tracking its own deliveries with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found