You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
The workaround for this issue (until it's fixed in babel-plugin-lodash) , you have to do the following modification in you babel.config.js file:
/** * 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. */constconsoleTrace=console.trace.bind(console);console.trace=(message, ...optionalParams)=>{if(typeofmessage==='string'&&message.startsWith('`isModuleDeclaration` has been deprecated')){returnundefined;// noop}returnconsoleTrace(message, ...optionalParams);};module.exports={
...babel-config...}
Reacted by Pionxzh, llxsgdsg, 拾迹, Stefan Georgiev, Chandler Van De Water, Baic and Hendra
Reacted by Honza Hrubý, Sabrina Bourouis, Dave Lunny, Warren Parad, s24sherzog, Marwan Mustafa, aarowman, praveenNagaraj-zartek, Boris Shifrin, Lorenzo and 8 more
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
Reacted by Chandler Van De Water, Anton Patrikeiev, william-will-angi, Eleven, aarowman, Thibaut Mottet, Richard Jeffords, Masoud G Sarini, s24sherzog, Max Liashuk and 9 more
I'm using gatsby@5.10.0 that looks to have babel-plugin-lodash@3.3.4 as a dependency package and I'm getting this issue as a warning when I run npm run develop. I've attempted to update the package.json file as mentioned previously, but this hasn't worked.
Is there an expected fix for this? Looks like a PR is open but has not been approved/merged: #261
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.
Activity
qqjay2017 commentedon Feb 21, 2023
me too , what can i do to fix it
sggvision commentedon Feb 21, 2023
Same here
llxsgdsg commentedon Feb 21, 2023
me too
char0n commentedon Feb 21, 2023
The workaround for this issue (until it's fixed in
babel-plugin-lodash) , you have to do the following modification in youbabel.config.jsfile:samuelslva-jlfs commentedon Feb 21, 2023
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
eleven-net-cn commentedon Feb 22, 2023
It works fine with npm
char0n commentedon Feb 22, 2023
Yep npm
overridesis a good solution as well, but be sure to be usingnpm >= 8.3.0. Earlier versions of npm don't supportoverrides.Force a newer version of @babel/types
miqdad-f commentedon Jun 6, 2023
If you are using pnpm, you can use this instead
justtoconfirm commentedon Jun 6, 2023
I'm using
gatsby@5.10.0that looks to havebabel-plugin-lodash@3.3.4as a dependency package and I'm getting this issue as a warning when I runnpm run develop. I've attempted to update thepackage.jsonfile as mentioned previously, but this hasn't worked.Is there an expected fix for this? Looks like a PR is open but has not been approved/merged: #261
Semigradsky commentedon Jun 6, 2023
This plugin looks unmaintained. Can anyone publish a fork with fix?
UPD: @sigmacomputing/babel-plugin-lodash
arsinclair commentedon Jul 19, 2023
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?
ThiefMaster commentedon Aug 1, 2023
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.
kirkstrobeck commentedon Aug 18, 2023
Note the warning in #259 (comment)
It’s best to just set this in your
package.jsondeps{ "devDependencies": { "@babel/core": "~7.20.0", } }update the dep later
fix isModuleDeclaration has been deprecated
fix isModuleDeclaration has been deprecated
gknapp commentedon Sep 6, 2023
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/corewith this installed (time of writing 7.22.15).