Fix issue #87 - Error: unexpected top-level await with Node 23 ESM - #90
Conversation
|
can this be released to npm? thanks! |
|
@perrin4869 tbh, I am not sure it is a good thing. The point of the dynamic imports were to avoid importing unused code (depending on the fact you choose to use one module over another). This change introduce the import of both which is probably not what we want and may break some priori usages of this module. Would be nice to have more input from @timint and @pioug and their thinking about it before pushing a new version. Maybe that we could ship a beta module first. |
|
Also, I couldn't dive in further yet, but I thought that top level awaits were supposed to work in recent node versions. Has it changed for new node one and why? |
|
I think it’s best to make this fix available to everyone. There’s not much activity in the project now, so while people are still willing to report and fix issues, I think it’s okay to go along before an alternative comes up or people stop caring. Importing unused code may not be a big deal for this type of tool (and we can always optimize it again in the future). There’s a chance it could break existing usage, but versioning can cover us, and again, I feel like it's more important to make it work for people who are in updated/recent environments. I was thinking about bumping a major version. I’m worried that we won’t get enough exposure from a beta release. A beta release would still require work upstream to get the beta version. I’m sorry for merging the PR without your approval 🙈 About top-level awaits, it seems like the mix of CJS and ESM can cause problems. Running just the lib works fine, but I can imagine some issues when adding in Gulp and Gulp plugins. |
|
@pioug Thanks for your reply, make sense to me. I just published |
|
some additional insight: |
No description provided.