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

Import parallel fails with "Cannot find main entry point" #187

Closed
benbucksch opened this issue May 14, 2020 · 3 comments
Closed

Import parallel fails with "Cannot find main entry point" #187

benbucksch opened this issue May 14, 2020 · 3 comments

Comments

@benbucksch
Copy link
Contributor

Reproduction:

  1. Install: yarn add https://github.com/parallel-js/parallel.js
  2. Code: import Parallel from 'paralleljs';
  3. Run: node --experimental-modules myapp.js (ESM experimental, using node v13.2.0)

Actual result:
Error: "Cannot find main entry point" in package.json

(node:1010476) ExperimentalWarning: The ESM module loader is experimental.
internal/modules/esm/default_resolve.js:94
  let url = moduleWrapResolve(specifier, parentURL);
            ^

Error: Cannot find main entry point for .../node_modules/paralleljs/ imported from .../myapp.js
    at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:94:13)
    at Loader.resolve (internal/modules/esm/loader.js:74:33)
    at Loader.getModuleJob (internal/modules/esm/loader.js:148:40)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:41:40)
    at link (internal/modules/esm/module_job.js:40:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
error Command failed with exit code 1.

Expected result:
Imports and runs

@benbucksch
Copy link
Contributor Author

The fix is trivial: Add

  "main": "lib/parallel.js",

to package.json

@benbucksch
Copy link
Contributor Author

benbucksch commented May 14, 2020

Fixed by PR #188

@benbucksch
Copy link
Contributor Author

PR was merged. Thanks, @mathiasrw !

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

1 participant