Skip to content
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

Update to google-closure-compiler@20240317.0.0 #96

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bpasero
Copy link
Contributor

@bpasero bpasero commented Jul 9, 2024

fix #97

👋 We (VS Code) are in the process of moving to ESM (microsoft/vscode#166033) and are running into an issue when loading jschardet.min.js into our node.js environment. The error was no longer reproducible when moving to a newer version of google-closure-compiler, in fact even just the next version v20151216 fixes it.

The error we see is when attempting to load jschardet.min.js with a custom loader we implement to bridge between ESM and CommonJS/AMD. The error is:

TypeError: Cannot read properties of undefined (reading 'iterator')
      at $jscomp.initSymbolIterator (evalmachine.<anonymous>:1:384)
      at $jscomp.makeIterator (evalmachine.<anonymous>:2:42)
      at evalmachine.<anonymous>:164:334
      at new c (evalmachine.<anonymous>:164:465)
      at evalmachine.<anonymous>:662:132
      at 42../constants (evalmachine.<anonymous>:662:395)

There is more context in microsoft/vscode#160416 (comment) and onward.

I think with newer versions of google-closure-compiler some polyfills are no longer applied that maybe lead to this issue 🤔

Curious why this project has never updated this dependency to a later version. With this PR the latest version is picked and obviously the change in jschardet.min.js is rather large. Is there a way to validate this works in all environments?

@bpasero
Copy link
Contributor Author

bpasero commented Jul 9, 2024

I was able to distill a minimal repro in #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jschardet.min.js cannot be loaded into vm in node.js
1 participant