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

Incompatible with nodejs v12.11.0 and up #53

Closed
pke opened this issue Nov 21, 2019 · 1 comment
Closed

Incompatible with nodejs v12.11.0 and up #53

pke opened this issue Nov 21, 2019 · 1 comment

Comments

@pke
Copy link

pke commented Nov 21, 2019

It seems node changed the way modules are loaded. I am getting

> pta src/**/*.test.js

internal/modules/cjs/loader.js:958
      throw new ERR_REQUIRE_ESM(filename);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /var/storage/dev/projects/private/xstate.io/node_modules/zora/dist/bundle/index.js
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:958:13)
    at Module.load (internal/modules/cjs/loader.js:798:32)
    at Function.Module._load (internal/modules/cjs/loader.js:711:12)
    at Module.require (internal/modules/cjs/loader.js:838:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/var/storage/dev/projects/private/xstate.io/node_modules/pta/src/cli.js:8:52)
    at Module._compile (internal/modules/cjs/loader.js:945:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:962:10)
    at Module.load (internal/modules/cjs/loader.js:798:32)
    at Function.Module._load (internal/modules/cjs/loader.js:711:12)
npm ERR! Test failed.  See above for more details.

on nodejs 12.11.0

@lorenzofox3
Copy link
Owner

Thanks for the report. It seems I misunderstood how to deal with type and main field in zora's package.json file. I have removed "type"="module and preserved a cjs version for backward compatibility.
Upgrade zora and it should work fine.

@lorenzofox3 lorenzofox3 transferred this issue from lorenzofox3/zora-node Nov 22, 2019
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

No branches or pull requests

2 participants