LoginSignup
4
4

More than 5 years have passed since last update.

Nuxt 2.0.0から2.4.0にアップデートしたときに起こったエラーについて

Last updated at Posted at 2019-01-31

概要

とある理由でnuxt 2.0.0からnuxt2.4.0にアップデートすることがあり、スムーズにアップデートできなかったので備忘録

Nuxtのバージョン

"nuxt": "2.0.0-25638738.d69b4b8"

"nuxt": "2.4.0"

エラー

何故かrouter.jsのimport部分でコケる

Module parse failed: Unexpected token (11:10)
You may need an appropriate loader to handle this file type.
|       var AsyncHome = asyncComponent(appendAsyncReducer, epicSubject$, function () {
|         return process.env.SERVER ? require('./home')
>         : import(
|         /* webpackChunkName: "accusations" */
|         './home');
 @ ./server/ssr.js 15:0-34 167:25-34
 @ ./server/index.js

解決方法

rm -rf node_modules package-lock.json
# 必要であればキャッシュを消す
npm cache clean --force
npm install webpack@4.28.4 --save-dev --save-exact
npm install acorn-dynamic-import@4.0.0 --save-dev
npm install acorn@6.0.5 --save-dev
npm update acorn --depth 20
npm dedupe

参考

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4