-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Missing "./package.json" export in "d3-scale" package (and others) #3053
Comments
Interestingly... adding vite: {
optimizeDeps: {
include: [
'd3-array',
'd3-format',
'd3-time',
],
},
}, and adding vite: {
optimizeDeps: {
include: [
'd3-scale',
'd3-shape',
'd3-time',
'd3-array',
'd3-format'
],
},
}, Each SvelteKit / Vite release I seem to always play the game of what to put in Along with fixing the d3 issue, I know adding these always saves Vite from rediscovering dependencies, which sometimes takes a few passes on initial startup from a clean cache, or as you access a route with new dependencies. |
|
Some initial investigation. I'm able to reproduce them in the stackblitz repros, but when I clone locally and run it, it worked without errors (macos m1). I can find the offending code through the stack trace, but it should technically still be fine. Gonna deep dive this tomorrow. Otherwise, the workaround |
In my project this appears to be fixed by upgrading to the just-released Vite 2.7.10. I'm guessing it was vitejs/vite#6306. |
I had the same problem with UPDATE: as @dimfeld mentioned, this issue seems to be solved after the update.. |
Ah that's really great news! This has been in my backlog for too long now. Closing this. |
Describe the bug
After upgrading my LayerChart visualization component library to SvelteKit 1.0.0-next.202 which includes
Vite 2.7
, I now receive a bunch of the following errors on startup for many d3 packages (d3-scale
,d3-shape
,d3-array
,d3-time
)...What's very perplexing is I didn't have this issue last night and even deployed multiple times via Vercel without any issues.
Based on the error, it seems like the proper fix would be to update all d3 packages (ex. d3-scale) and add
./package.json
toexports
, although I'm not sure I'm up for PR'ing 50+ packages and how long it would take to get reviewed / merged / released. I also want to make sure its truly required as well :).I'm also having trouble limiting the example below LayerChart (installing / importing either
LayerCake
(which LayerChart is built upon) ord3-scale
does not throw the error. LayerChart also uses my svelte-ux component library which has some d3 references so I don't know if it's a transitive issue.While writing this I just realized svelte-ux has the same issue, and is similar that it worked last night and deployed to Vercel multiple times.
Reproduction
Here are 2 StackBlitz reproductions for each project:
Logs
No response
System Info
Severity
blocking an upgrade
Additional Information
Related?
Some related discussions with mhkeller in LayerCake (see referenced issues/PRs as well)
The text was updated successfully, but these errors were encountered: