-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Dependencies need to be ESM #153
Comments
Thanks for reaching out @benmccann! It's also worth noting the Vite is planning to fix this so it would work by default vitejs/vite#3024 (comment) and there is a work around available today without needing to change packages vitejs/vite#3024 (comment)
I'm happy to see improvements in unified's dependencies. 👍
I'm happy to change unified's dependencies, if there are security, performance, or stability benefits. 👍 I'm cautious changing dependencies only for the sake of working around a short term bug in a particular tool chain. We definitely want to offer a path for folks to upgrade across a variety of tool chains. Happy to discuss dependency changes or help with documentation! |
@ChristianMurphy , @benmccann ... I've opened this PR to help out: justmoon/node-extend#57 |
No, I disagree. Of course: hopefully in the future we can ditch CJS! But Vite is broken. Not unified. As Christian mentioned, we can discuss how to teach folks how to use Vite with npm and unified, but I’m closing this because it’s not actionable. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This would be helpful, I can't get unified to work in the SSR part of SvelteKit (Vite-based): I get When I have:
I get |
Initial checklist
Affected packages and versions
all
Link to runnable example
No response
Steps to reproduce
Provided in sveltejs/kit#1961
Expected behavior
All dependencies should be ESM since this package declares
"type": "module"
. The package should work out-of-the-box with SvelteKit and ViteThis can be fixed by distributing an ESM version of
is-buffer
andextend
or by removing those dependencies from this library since they have minimal usage. I've sent a PR foris-buffer
feross/is-buffer#43 though I don't know yet whether it will be acceptedThis could be added a sub-task to #121
Actual behavior
Vite encounters CJS dependency of this ESM module and fails with the message
module is not defined
as described in vitejs/vite-plugin-react#30Runtime
Node v14, Other (please specify in steps to reproduce)
Package manager
npm v7
OS
Linux
Build and bundle tools
Vite
The text was updated successfully, but these errors were encountered: