Skip to content

Module interpreted as global module format, but called System.register. #3

@dara76

Description

@dara76

This is part of a simplified test example that can be found at https://github.com/dara76/node-serve-jspm-test

I have the following in my index.html

 <script src="jspm_packages/system.js"></script>
 <script src="config.js"></script>
 <script>
      System.trace = true;
      System.import('./app/main');
  </script>

where main.js is

console.log('main.js');                                                                  
import React from 'react';  

I get the following error

Uncaught (in promise) Error: (SystemJS) Module http://localhost:3000/app/main.js interpreted as global module format, but called System.register.

If I remove the import React from 'react' statement from main.js there is no error and the console.log executes.

How can I avoid getting the above error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions