babel / minify

:scissors: An ES6+ aware minifier based on the Babel toolchain (beta)
https://babeljs.io/repl
MIT License
4.39k stars 225 forks source link

traverse.clearCache is not a function #813

Open marvinhagemeister opened 6 years ago

marvinhagemeister commented 6 years ago

Input Code

const foo = "foo";
const bar = `asdf ${foo} asd ${foo}`

Babel REPL link

Actual Output

traverse.clearCache is not a function. (In 'traverse.clearCache()', 'traverse.clearCache' is undefined)

Expected Output

const bar = `asdf foo asd foo`

Details

Noticed this bug when playing around on the repl. Only the minify plugin is enabled.

mgol commented 6 years ago

I'm hitting it as well, it's enough to enable "Minify" on any code to make it break.

An updated REPL link (the one from the OP doesn't work for me): https://babeljs.io/repl#?babili=true&browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=G4QwTgBCELwQTAbgFBA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&sourceType=module&lineWrap=false&presets=babili&prettier=false&targets=&version=7.0.0-alpha.19&envVersion=2.0.0-beta.2

mythmon commented 6 years ago

I ran into this problem on my project (mozilla/normandy#1510, mentioned above) and was able to fix it by changing from babel-preset-babili@0.1.4 to the renamed babel-minify-webpack-plugin@0.3.1. That doesn't explain the problem with the repl though.

rhuanbarreto commented 5 years ago

Also got the same problem.

jackyef commented 5 years ago

Also found this while playing around with the online repl. Any updates on this one?

gongpeione commented 4 years ago

I got the same problem here, any update?