Skip to content

Delay importing the util package to fix browser compatibility#103

Open
johnsoncodehk wants to merge 1 commit into
microsoft:mainfrom
johnsoncodehk:main
Open

Delay importing the util package to fix browser compatibility#103
johnsoncodehk wants to merge 1 commit into
microsoft:mainfrom
johnsoncodehk:main

Conversation

@johnsoncodehk

Copy link
Copy Markdown
Contributor

This PR fixes vuejs/repl#258

decoder = new TextDecoder();

This line uses the TextDecoder imported from the util package as a fallback for the Node.js environment. However, since the util package is imported globally, it always breaks browser execution.

The fix is to lazily import the util package only within the fallback branch for the Node.js environment.

Related to browserify/node-util#77.

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.

Emmet support

1 participant