-
Notifications
You must be signed in to change notification settings - Fork 96
isModuleDeclaration
has been deprecated
#259
isModuleDeclaration
has been deprecated
#259
Comments
me too , what can i do to fix it |
Same here |
me too |
The workaround for this issue (until it's fixed in /**
* This is override for https://github.com/lodash/babel-plugin-lodash/issues/259.
* babel-plugin-lodash is using deprecated babel API, which causes generation of many
* console.trace calls.
*/
const consoleTrace = console.trace.bind(console);
console.trace = (message, ...optionalParams) => {
if (
typeof message === 'string' &&
message.startsWith('`isModuleDeclaration` has been deprecated')
) {
return undefined; // noop
}
return consoleTrace(message, ...optionalParams);
};
module.exports = {
...babel-config...
} |
or if you use yarn, in package.json: {
// [...]
"resolutions": {
"babel-plugin-lodash/@babel/types": "~7.20.0"
}
} EDIT: if you use NPM use this instead on your package.json (I guess, according to the docs) {
// [...]
"overrides": {
"babel-plugin-lodash": {
"@babel/types": "~7.20.0"
}
}
} EDIT2: Be careful with this solution this will lock you forever on an old @babel/types version, right now its fine as we wait for babel/babel#15448 be released and we're a single minor behind, but don't rely on this forever, there might be security/performance improvements on babel (unless when remove the deprecated method outright then locking will be the only option), the real solution would be this project updating the deprecated reference, both mine and @char0n's solutions are palliatives. Stay on top of this issue to either replace this (seemly abandoned) library, or get a new version of this that doesn't need the version locking or warning clobbering |
It works fine with npm |
Yep npm |
lodash/babel-plugin-lodash#259 was causing a huge amount of problematic output, which seems to have failed the Netlify build.
If you are using pnpm, you can use this instead "pnpm": {
"overrides": {
"babel-plugin-lodash>@babel/types": "~7.20.0"
}
} |
I'm using Is there an expected fix for this? Looks like a PR is open but has not been approved/merged: #261 |
This plugin looks unmaintained. Can anyone publish a fork with fix? |
Forking is the worst option, since it doesn't solve the issue for the ecosystem that relies on the plugin (e.g. GatsbyJS). I think we should as much as possible try to draw the attention of maintainers here. There seems to be an easy fix for the issue. @jdalton @mathiasbynens @veksen any thoughts? |
I'd also love to see an update - the warning is harmless (so far, dunno when the deprecated object gets removed for good) but nonetheless annoying. |
Note the warning in #259 (comment) It’s best to just set this in your {
"devDependencies": {
"@babel/core": "~7.20.0",
}
} update the dep later |
I found just installing @babel/types to the latest 7.20 release silenced this message (I am tied to node v14 for a previous product release): {
"devDependencies": {
"@babel/types": "7.20.7"
}
} I am able to use the latest |
babel/babel#15266
@babel/types
v7.21.0,isModuleDeclaration
has been deprecated, the terminal has the following warning.The text was updated successfully, but these errors were encountered: