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

fix: plugin legacy - module output doesn't support Safari 10 #10100

Conversation

marco-prontera
Copy link

Description

When using the plugin-legacy the modern bundle of the app includes the dynamic import, and in safari 10 it throws a syntax error that blocks the parsing and the execution of the entire application.
safari 10.1 Syntax Error Unexpected Keyword import
Since this import is a thing used for a specific purpose I just implemented a parameter that let me prevent the plugin from using that forced dynamic import and keep the application running also in safari 10.

closes #10099

Additional context

With this plugin, we just inject the Safari 10 noModule fix, but when the 'esm' version of the application is parsed inside the Safari 10 browser and read the 'import' keyword the Syntax Error is thrown.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@marco-prontera marco-prontera changed the title Plugin legacy - module output doesn't support Safari 10 fix: plugin legacy - module output doesn't support Safari 10 Sep 13, 2022
@marco-prontera
Copy link
Author

If you don't like the parameter question, then we should check if it is possible to block the execution of the "modern" output in Safari 10 and favor the execution of the legacy version. How about?

@sapphi-red
Copy link
Member

I think it is intended to run the legacy chunk for Safari 10 because Safari 10 does not support dynamic import and import.meta. If the legacy chunk does not run for Safari 10, that is a bug.

related: #3885

@marco-prontera
Copy link
Author

I think it is intended to run the legacy chunk for Safari 10 because Safari 10 does not support dynamic import and import.meta. If the legacy chunk does not run for Safari 10, that is a bug.

related: #3885

next time I will check better, sorry

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.

Plugin legacy - module output doesn't support Safari 10
2 participants