Next.js: [Error][v8.0.4] TypeError: (0 , _typeof2.default) is not a function

Created on 3 Apr 2019  路  3Comments  路  Source: vercel/next.js

Bug report

Describe the bug

I am using v8.0.4. Everything OK in dev. But after I do next build and run my app the app stuck in server-side, then I get the TypeError: (0 , _typeof2.default) is not a function error. Does anyone has this issue?

To Reproduce

  1. Go to this repo
  2. Run yarn install
  3. Run yarn build
  4. Run yarn start
  5. You can see the error

Expected behavior

App can run without TypeError: (0 , _typeof2.default) is not a function error like as dev.

Screenshots

铻㈠箷蹇収 2019-04-04 涓婂崍12 46 00

System information

  • OS: macOS 10.14.2

    • Node.js: 10.15.2

  • Browser: Chrome
  • Version of Next.js: v8.0.4

Additional Information

Here's my packages.json :

{
  "name": "",
  "version": "",
  "description": "",
  "main": "app/index.js",
  "author": "",
  "scripts": {
    "dev": "nodemon app/server --exec babel-node",
    "build": "next build app",
    "start": "NODE_ENV=production node app"
  },
  "babel": {
    "presets": [
      "@babel/preset-env",
      "next/babel"
    ]
  },
  "dependencies": {
    "@babel/register": "^7.4.0",
    "express": "^4.16.4",
    "next": "^8.0.4",
    "next-routes": "^1.4.2",
    "react": "^16.8.6",
    "react-dom": "^16.8.6"
  },
  "devDependencies": {
    "@babel/node": "^7.2.2",
    "nodemon": "^1.18.10"
  }
}
needs investigation

Most helpful comment

Please show us your .babelrc file. I had the same problem and fixed by removing a @babel/preset-env. In the updated documentation it says:

The next/babel preset includes everything needed to transpile React applications. This includes:
preset-env

Good luck!

All 3 comments

Please provide a full reproduction, it's impossible to help based on the description provided.

I'm having same issue on 8.0.4. Not sure but i think it looks related to: "next/babel" preset.

Please show us your .babelrc file. I had the same problem and fixed by removing a @babel/preset-env. In the updated documentation it says:

The next/babel preset includes everything needed to transpile React applications. This includes:
preset-env

Good luck!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rauchg picture rauchg  路  208Comments

nvartolomei picture nvartolomei  路  78Comments

timneutkens picture timneutkens  路  250Comments

Vista1nik picture Vista1nik  路  55Comments

Timer picture Timer  路  90Comments