minify: Error: Couldn't find intersection
Describe the bug
After updating to 0.5, I started getting these errors…
Stack Trace
./node_modules/regenerator-runtime/runtime-module.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Couldn't find intersection
Error: Child compilation failed:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Couldn't find intersection
- ancestry.js:153 NodePath.getDeepestCommonAncestorFrom
[app]/[@babel]/traverse/lib/path/ancestry.js:153:11
- index.js:244 getSegmentedSubPaths
[app]/[babel-plugin-minify-builtins]/lib/index.js:244:14
- index.js:92 BuiltInReplacer.replace
[app]/[babel-plugin-minify-builtins]/lib/index.js:92:31
- index.js:205 PluginPass.exit
[app]/[babel-plugin-minify-builtins]/lib/index.js:205:27
- visitors.js:193 newFn
[app]/[@babel]/traverse/lib/visitors.js:193:21
- context.js:53 NodePath._call
[app]/[@babel]/traverse/lib/path/context.js:53:20
- context.js:40 NodePath.call
[app]/[@babel]/traverse/lib/path/context.js:40:17
- context.js:97 NodePath.visit
[app]/[@babel]/traverse/lib/path/context.js:97:8
- context.js:118 TraversalContext.visitQueue
[app]/[@babel]/traverse/lib/context.js:118:16
- context.js:90 TraversalContext.visitSingle
[app]/[@babel]/traverse/lib/context.js:90:19
- context.js:146 TraversalContext.visit
[app]/[@babel]/traverse/lib/context.js:146:19
- index.js:94 Function.traverse.node
[app]/[@babel]/traverse/lib/index.js:94:17
- index.js:76 traverse
[app]/[@babel]/traverse/lib/index.js:76:12
- index.js:88 transformFile
[app]/[@babel]/core/lib/transformation/index.js:88:29
- index.js:45 runSync
[app]/[@babel]/core/lib/transformation/index.js:45:3
Configuration
babel-minify preset in babel config
babel-minify version: 0.5.0
babel version : 7.1.0
babel-minify-config:
loader: require.resolve('babel-loader'),
options: {
babelrc: false,
sourceType: 'unambiguous',
compact: PROD,
presets: [
require.resolve('./babel.config.js'),
[require.resolve('babel-preset-minify'), {
mangle: false,
deadcode: false,
// simplify: false,
evaluate: false,
}]
]
}
babelrc:
{
sourceType: 'unambiguous',
compact: false,
presets: [
['@babel/preset-env', {
shippedProposals: true,
targets: [
'> 1% in US',
'last 2 versions',
'not dead',
]
}],
'@babel/preset-flow',
'@babel/preset-react',
],
plugins: [
'@babel/plugin-transform-runtime',
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-syntax-dynamic-import'
]
}
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 52
- Comments: 38
Commits related to this issue
- babel/minify: use `builtIns: false` See https://github.com/babel/minify/issues/904#issuecomment-424367995 — committed to storybookjs/storybook by Hypnosphi 6 years ago
- remove babel minify https://github.com/babel/minify/issues/904 — committed to comeon-group/babel-preset-comeon by fusionstrings 6 years ago
- Disable builtIn compression as this throws for some code e.g. https://github.com/babel/minify/issues/904 — committed to sebastian-software/babel-preset-edge by swernerx 6 years ago
- added workaround for failing js compression: https://github.com/babel/minify/issues/904 — committed to Teisi/typo3-gulp-scss by Teisi 5 years ago
- Did i walk into https://github.com/babel/minify/issues/904? — committed to ovanderzee/onscreenness by deleted user 5 years ago
- Downgrade babel-preset-minify from 0.5 to 0.4.3 [Old timer issue](https://github.com/babel/minify/issues/904#issuecomment-491542997). — committed to Sunappu-Dojo/burokku by meduzen 4 years ago
- fix `Can't find intersection` while try to import `../dist/vue-at-textarea.js` like https://github.com/babel/minify/issues/904 — committed to fritx/vue-at by fritx 2 years ago
- fix `Can't find intersection` while importing `../dist/vue-at-textarea.js` like https://github.com/babel/minify/issues/904 — committed to fritx/vue-at by fritx 2 years ago
- Workaround for babel script issues (https://github.com/babel/minify/issues/904) — committed to alextselegidis/easyappointments by alextselegidis a year ago
- BUGFIX. Get an error when compiling js with the `gulp` command Error: - Starting 'jsCompile'... 'jsCompile' errored after 341 ms Error in plugin "gulp-babel" Message: /Applications/MAMP/htdocs/ca... — committed to beatrizsmerino/calendar by beatrizsmerino a year ago
I have the same versions of libs and I had the same issue. Disabling
builtIns
helped me. I have these options now:It’s like a temporary fix
Same issue here. Changing
'minify'
to['minify', { builtIns: false }]
as @goozler suggested worked for me for now.I downgraded to ^0.4.3 to get it working.
Same here. I tried to upgrade to Babel 7 because of https://github.com/babel/minify/issues/556, and now the error journey just continues… Pretty disappointing experience.
Same issue, downgraded to 0.3.0 and it works okay now.
“babel-preset-minify”: “^0.3.0”,
confirm that @goozler solution works also for me with the same problems… it works setting only builtIns to false
Example here https://github.com/wende60/Javascript-Gallery
I’m just following the directions here and I’m getting this error:
I also fixed it by disabling
builtIns
, in this case it was in mybabel.config.js
file:Still an issue for me.
Solved with
Hi. As stated in the post, when I did the minify it displayed which file was causing the issue. I tried to minify ONLY that program and it worked. So I created two separate compiles - 1 for the offending program and another for all the others.
“build-min”: "babel ./a.js ./b.js --presets minify --out-dir ./build && babel ./c.js --presets minify --out-dir ./public/build"}
I got a same problem today too.
“babel-preset-minify”: “0.5.0”
Thanks! That worked for me. And for those using gulp-babel-minify:
.pipe(minify({ "builtIns": false, "mangle": false }))
In my case:
Append comments:
with
--builtIns false
option,Math.ceil
works fine!I’m also getting the same stack trace with “babel-preset-minify”: “^0.5.0-alpha.9”.