-
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
Export ESM #501
Comments
I came here to say the same thing. Thanks for the workaround but any ETA on a fix? |
Does anyone have a working Vue3 client example of this? I'm just bouncing between errors at the moment. |
Hi! Any updates? |
Can we give a test drive to |
Thanks for the heads up. I'm currently on paternal leave and won't have a chance to touch company code before December. |
@oski646 @bradintheusa - did you have a chance to test that? |
getstream
is currently exported as UMD only. ESM support has been around in NodeJS (and the browser) for some time and, I believe, since v12.20 it can be used without a flag. With NodeJS 16 being LTS at the time of this writing, I think it would be nice to provide an ESM export. The main advantage (for me, anyway) would be to use the same syntax when importing from a CDN andnode_modules
, rather than using a global variable.Further reading:
While I don't want to get too specific on my own code, I would like to provide an example where this would help developers. When using Vite's development server, I can't import
getstream
from without running into NodeJS-specific problems (this issue is possibly related). The same import works fine when Vite builds my code and optimizes it for the browser. Currently, my only workaround is to change the import fromimport stream from "getstream"
toimport "https://cdn.jsdelivr.net/npm/[email protected]/dist/js_min/getstream.js"
. However, I need to undo this change whenever I build, since I want to import the locally installed npm package ofgetstream
. If you provided an (browser-optimized) ESM, I could simply put a condition onNODE_ENV
in my config file (example below), not rewriting my import on every switch between development and build.The text was updated successfully, but these errors were encountered: