question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Babel error at next/babel.js after upgrade from 5.0.0 to 6.0.0

See original GitHub issue

I decided to upgrade to newest next release 6.0.0 just hour ago and received this error:

Expected Behavior

No error with 5.0.0

Current Behavior

Error

C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\file\options\option-manager.js:328
        throw e;
        ^

Error: Plugin 0 specified in "C:\\Users\\aarta\\Documents\\PersonalFiles\\Projects\\WEBprojects\\rearn\\node_modules\\next\\babel.js" provided an invalid property of "default" (While processing preset: "C:\\Users\\aarta\\Documents\\PersonalFiles\\Projects\\WEBprojects\\rearn\\node_modules\\next\\babel.js")
    at Plugin.init (C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\plugin.js:131:13)
    at Function.normalisePlugin (C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\file\options\option-manager.js:152:12)
    at C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\file\options\option-manager.js:184:30
    at Array.map (<anonymous>)
    at Function.normalisePlugins (C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20)
    at OptionManager.mergeOptions (C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36)
    at C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\file\options\option-manager.js:265:14
    at C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\file\options\option-manager.js:323:22
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (C:\Users\aarta\Documents\PersonalFiles\Projects\WEBprojects\rearn\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)

.babelrc

{
    "presets": [
        "env",
        "next/babel"
    ]
}

package.json

{
  "name": "rearn",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "next build",
    "start": "cross-env NODE_ENV=production babel-node server/server.js",
    "test": "eslint pages components lib",
    "dev": "nodemon server/server.js --watch server --exec babel-node server/server.js",
    "port": "cross-env PORT=4000 npm start",
    "prod": "yarn build && cross-env NODE_ENV=production babel-node server/server.js",
    "precommit": "yarn test",
    "prepush": "yarn test"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@zeit/next-sass": "^0.1.2",
    "axios": "^0.18.0",
    "bootstrap": "4.0.0",
    "bootstrap-material-design": "^4.1.1",
    "connect-mongo": "^2.0.1",
    "cross-env": "^5.1.4",
    "dotenv": "^5.0.1",
    "express": "^4.16.3",
    "express-session": "^1.15.6",
    "express-useragent": "^1.0.12",
    "jquery": "^3.3.1",
    "material-ui": "^0.20.0",
    "mongoose": "^5.0.15",
    "next": "6.0.0",
    "next-offline": "^2.5.0",
    "next-redux-wrapper": "^1.3.5",
    "node-sass": "^4.8.3",
    "passport": "^0.4.0",
    "passport-google-oauth": "^1.0.0",
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-popper": "^0.10.1",
    "react-redux": "^5.0.7",
    "react-reveal": "^1.2.1",
    "react-transition-group": "^2.3.0",
    "redux": "^4.0.0",
    "redux-form": "^7.3.0",
    "redux-thunk": "^2.2.0",
    "styled-jsx": "^2.2.6",
    "workbox-background-sync": "^3.0.1"
  },
  "browserslist": [
    "> 1%"
  ],
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "eslint": "4.9.0",
    "eslint-config-airbnb": "16.1.0",
    "eslint-plugin-compat": "^2.2.0",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-jsx-a11y": "6.0.2",
    "eslint-plugin-react": "7.4.0",
    "husky": "^0.14.3"
  }
}

Steps to Reproduce (for bugs)

  1. Have next^5.0.0 at package.json
  2. yarn upgrade next@^6.0.0

Your Environment

Tech Version
next 6.0.0
node 8.9.3
OS Windows 10 x64
browser Chrome 65.0.3325.181

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
neone35commented, Apr 30, 2018

Now babel doesn’t work, as it shows unexpected token import..

0reactions
tashburncommented, May 8, 2018

I’m also getting unexpected toke import, and not using babelrc

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build error next.js 6.0.0 · Issue #4227 - GitHub
Update : I updated all my babel dependencies and babel-node to version 7 so it passed now. But now, I get this error....
Read more >
Parsing error : Cannot find module 'next/babel' - Stack Overflow
Upgrade React version to latest Most applications already use the latest version of React, with Next.js 11 the minimum React version has been...
Read more >
eslint: failed to load config "next/babel" to extend from. - You.com
I was missing the package @vue/prettier/@typescript-eslint, after installing the package version matching my package.json, I was good. Hope that helps someone.
Read more >
Blog - Next.js 7
This is a comparison of the before and after of our errors: ... In addition to upgrading to Babel 7, the Next.js Babel...
Read more >
build - webpack-config.js.map - UNPKG
next/dist/build/webpack-config.js.map ... {\n // The loaders Next.js provides\n alias: [\n 'emit-file-loader',\n 'error-loader',\n 'next-babel-loader',\n ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found