Esm: "type": "module" in package.json throws an error

Created on 21 Apr 2019  路  3Comments  路  Source: standard-things/esm

I'm running the SystemJS tests with mocha -b -r esm, where the package.json of SystemJS didn't previously have "type": "module" set. The tests are located in test/*.js.

As soon as I added "type": "module" to the package, I get the error:

/home/guybedford/Projects/systemjs/test/import-map.js:1
import './fixtures/tracing.js';
       ^

SyntaxError: Unexpected string
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)

Setting "mode": "all" or "use module" doesn't seem to fix this either.

Any help would be much appreciated.

bug

Most helpful comment

Any chance to get a release with this fix?

All 3 comments

You caught me with partial supported added.
I'll revert the partial type support until I can better support it fully.

Thanks, yeah as long as it doesn't throw I'd be happy :)

Any chance to get a release with this fix?

Was this page helpful?
0 / 5 - 0 ratings