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

Throws when used with --experimental-modules #90

Closed
matthewp opened this issue Jun 27, 2018 · 2 comments
Closed

Throws when used with --experimental-modules #90

matthewp opened this issue Jun 27, 2018 · 2 comments

Comments

@matthewp
Copy link

If using an mjs module using --experimental-modules and importing meow it throws on this line:

meow/index.js

Line 15 in 258659a

const parentDir = path.dirname(module.parent.filename);

I think this might be the Node issue: nodejs/node#15760

@sindresorhus
Copy link
Owner

Open an issue on Node.js. They'll need to create a replacement for module.parent. Closing as I don't intend to do anything for experimental features.

@matthewp
Copy link
Author

According to that issue there won't be a replacement for module.parent in the case where a commonjs module is imported by an ES module. So if parentDir is required then this might need to change to be an ES module (although I'm not certain it would work the other way then). Anyways, something for another time as you prefer to wait for the feature to be out of experimental.

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 a pull request may close this issue.

2 participants