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

Make Vite sample code Firefox compatible #2991

Merged
merged 2 commits into from
Feb 24, 2022

Conversation

Dan1ve
Copy link
Contributor

@Dan1ve Dan1ve commented Feb 23, 2022

The current sample code for "Using Vite" works fine in Chrome, but causes errors in Firefox:

Error: import declarations may only appear at top level of a module

In addition to many errors logged to the console, this also causes subtle bugs in Firefox (e.g. the highlighting in the diff editor didn't work).

The problem appears to be that Firefox requires an explicit type: module for the web workers.

The revised implementation for Vite takes this into account and has been tested successfully in Chrome and Firefox.

The current sample code for "Using Vite" works fine in Chrome, but causes errors in Firefox: 

`Error: import declarations may only appear at top level of a module`

In addition to many errors logged to the console, this also causes subtle bugs in Firefox (e.g. the highlighting in the diff editor didn't work).

The problem appears to be that Firefox requires an explicit `type: module` for the web workers.

The revised implementation for Vite takes this into account and has been tested successfully in Chrome and Firefox.
@hediet
Copy link
Member

hediet commented Feb 24, 2022

Thanks for the PR!

@hediet hediet added this to the February 2022 milestone Feb 24, 2022
@hediet hediet merged commit 72b7b1e into microsoft:main Feb 24, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants