LoginSignup
0
0

More than 5 years have passed since last update.

nuxtでnuxt devはできるのにnuxt buildだと Name expectedエラーで死ぬ

Posted at

nuxt build すると死ぬ案件

nuxtbuildの結果
$ nuxt build
(略)
  ERROR in common.xxxxxxxxxxx.js from UglifyJs
  Name expected [./node_modules/whatwg-url/lib/URLSearchParams.js:11,0][common.xxxxxxxxxx.js:14903,12]
    Error: Webpack build exited with errors
(略)

闇深い案件だったけど原因は nuxt.config.jsbuild.vendor@nuxtjs/axios を追加してたせい。

(確証は何もないんだけど) build.vendor内でES2015的なシンタックスは機能しないみがあるんだけど、 @nuxtjs/axios が依存してる whatwg-urlconst { target, kind, index } = internal; みたいなシンタックスで書かれてて、ここの解釈で死んだっぽい。

シンタックス合ってるようにしか見えないし、何が問題なのかマジわからんくてクッソハマったけど、nuxt.config.jsを修正して無事に解決しました:pray:

0
0
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
0
0