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: systemjs dynamically import error #370

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

Conversation

includeios
Copy link
Contributor

Description

Plugin will get an error when importing a dynamical systemjs module, as this issues say

Uncaught (in promise) TypeError: remote.init is not a function

Because the plugin deals with systemjs as same as esm. but systemjs need to use System.import to import dynamic modules according to systemjs readme, and I think it is better to add a hint: we need to manually import systemjs in the project when you need remotes systemjs format module. Thank you

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@ruleeeer ruleeeer self-requested a review March 18, 2023 10:54
@ruleeeer
Copy link
Collaborator

Theoretically, this part of the code should be completed by vite rather than manually. When we set format: 'systemjs', import should be automatically changed to module.import.

@ruleeeer
Copy link
Collaborator

You can change the format in the configuration file of vite to see if the conversion of import->module.import has occurred.Of course, it is also possible that I missed some special usage scenarios..

build: {
        rollupOptions: {
            output: {
                format:'system'
            }
        }
    }

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.

None yet

2 participants