Skip to content

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

@Jiannan-dev Jiannan-dev self-requested a review March 18, 2023 10:54
@Jiannan-dev
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.

@Jiannan-dev
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.

2 participants