babel / babel/minify

Error: Couldn't find intersection

Open
#904 40 comments 53 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
4.4k
Forks
217
PR merge metrics
No merged PRs in 30d

Description

**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:

```json5
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:

```json5
{
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'
]
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.