-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
7.x: regressionHas PRarea: modulesoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Choose one: is this a bug report or feature request?
Input Code
// actions.js
const types = {
FOO: 'FOO',
BAR: 'BAR',
}
export default {
[types.FOO]() {},
[types.BAR]() {},
}
// index.js
import actions from './actions'Babel/Babylon Configuration (.babelrc, package.json, cli command)
// package.json
"devDependencies": {
"@babel/core": "^7.0.0-beta.36",
"@babel/plugin-transform-runtime": "^7.0.0-beta.36",
"@babel/preset-env": "^7.0.0-beta.36",
"@babel/runtime": "^7.0.0-beta.36",
"babel-loader": "^8.0.0-beta.0",
"webpack": "^3.10.0"
}
// .babelrc
{
"presets": [
["@babel/env", {
"modules": false,
"useBuiltIns": "usage"
}]
],
"plugins": [
"@babel/transform-runtime"
]
}
You can clone the repo with reproduction: https://github.com/sqal/babel-7.0.0-beta.36-bug
Expected Behavior
I expect default import in index.js (actions) to be present
Current Behavior
Default import in index.js is not present. I am getting an error instead:
"export 'default' (imported as 'actions') was not found in './actions'
This is somehow related to transform-runtime plugin along with using computed property names in default export. When I disable transform-runtime, everything works properly. My current workaround for this:
const actions = { ... }
export default actions;Your Environment
| software | version(s) |
|---|---|
| Babel | 7.0.0-beta.36 |
| node | 8.5.0 |
| npm | 5.5.1 |
| Operating System | Windows 10 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
7.x: regressionHas PRarea: modulesoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue