-
Notifications
You must be signed in to change notification settings - Fork 55
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
module.parent deprecated in Node 14+ #141
Comments
@jackfranklin:
const parentDir = path.dirname(module.parent.filename);
|
I’m on vacation right now, but I’ll take a look at this next week. In the meantime, happy to review a PR if you’re inclined. |
any updates on the issue? |
I'm unable to replicate this issue on Node 14.18. Can you provide a repo that I'm able to replicate please? How are you trying to instantiate the plugin? Can you try |
I encountered this problem today as well, while trying to convert my gulpfile to use ESM. I am using the following in import gulpLoadPlugins from 'gulp-load-plugins';
const $ = gulpLoadPlugins(); I am running Node.js 16.14.2. |
Happy to look into this if someone can create a repo with a reproducible issue. I'm using Node v16.14.0 right now with |
can you try this instead of the multi-line statement? const $ = require('gulp-load-plugins')(); |
I created this repo to demonstrate the situation with using Gulp as an ECMAScript module (ESM). The |
Also dealing with the issue @daedam mentioned. Using your suggestion @jameelmoses of: In my gulpfile.babel.js: |
This has been resolved in v2.0.8 |
For everyone for whom this option did not work:
I resolved it by the next code:
|
Describe the bug
As of Node v14.6.0,
module.parent
is deprecated.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect my node environment to startup like it always has.
Desktop (please complete the following information):
Temporary Fix
I've removed the
parentDir
variable fromindex.js
and placed thepath.dirname(module.parent.filename)
value inside theconfig
variable on line 47. It now looks like this:I now initialize the plugin inside my
gulpfile.babel.js
like this:The text was updated successfully, but these errors were encountered: