babel / babel/babel-upgrade

Upgrade failed

Open
#113 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.3k
Forks
53
PR merge metrics
No merged PRs in 30d

Description

I tried to use `babel-upgrade` to upgrade my project from Babel 6 to Babel 7.

I've used the command:

```
babel-upgrade --write --install
```

This is how it affected my `package.json` dependencies:

```diff
- "babel-cli": "~6.26.0",
- "babel-core": "~6.26.0",
- "babel-eslint": "~8.0.3",
- "babel-loader": "^7.1.4",
- "babel-plugin-transform-object-rest-spread": "6.26.0",
- "babel-polyfill": "~6.26.0",
- "babel-preset-es2015": "^6.24.1",
- "babel-register": "^6.26.0",

+ "@babel/cli": "^7.0.0",
+ "@babel/core": "^7.0.0",
+ "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
+ "@babel/polyfill": "^7.0.0",
+ "@babel/preset-env": "^7.0.0",
+ "@babel/register": "^7.0.0",
+ "babel-eslint": "^9.0.0",
+ "babel-loader": "^8.0.0",
```

However my build is now broken and I get the following errors:

```
ERROR in ./src/app/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
ReferenceError: Unknown plugin "@babel/plugin-proposal-object-rest-spread" specified in "/path/to/myapp/.babelrc" at 0, attempted to resolve relative to "/path/to/myapp"
```

```
ERROR in ./src/app/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'babel-preset-es2015' from '/path/to/myapp'
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the upgrade with `babel-upgrade --write --install` and inspect the resulting `package.json` and `.babelrc`; the reported failure occurs while building `src/app/index.js`. Check how the generated Babel 7 dependencies and configuration interact, then verify that the project builds without the missing-plugin and missing-preset errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.