デプロイ時にずっと「Initializing」のまま

同プロジェクトでデプロイ中のデプロイメントがあると、それが終わるまで最新のデプロイは「Initializing」になるようです。

now ls 

を実行し、いらないデプロイメントを削除してみると治るかもしれません。

build 時

UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '//../../.svgo.yml'

(node:1) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '//../../.svgo.yml'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at e.exports (/var/task/.next/server/static/iqdZhcAsT3LfSmq39Ilkz/pages/_document.js:206:307121)
    at new u (/var/task/.next/server/static/iqdZhcAsT3LfSmq39Ilkz/pages/_document.js:18:123)
    at TPFN.t.default.r.default.plugin (/var/task/.next/server/static/iqdZhcAsT3LfSmq39Ilkz/pages/_document.js:20:223985)
    at n (/var/task/.next/server/static/iqdZhcAsT3LfSmq39Ilkz/pages/_document.js:20:50105)
    at /var/task/.next/server/static/iqdZhcAsT3LfSmq39Ilkz/pages/_document.js:206:21288
    at 

now(2)へのデプロイ時に、svgo 付近のパス周りで__dirnameundefinedなのが原因かも。

postcsscssnano_document.tsxで使っていたのでこれをやめて、さらにpostcsscssnanoをアンインストールして依存から外した。これでsvgo依存も無くなり表示できるようになった。

TypeError: r.isMemo is not a function

now(2)へ@now/nextでのデプロイ時に。

Error: pages/index.js from Terser

next.config.jsの Webpack の設定で EnvironmentPluginNODE_ENV=production と上書きしていたので、これをやめた。

TypeError: Cannot read property 'minify' of undefined

2019-02-04発生。

terser@3.14.1を指定する

yarn add terser@3.14.1

package.jsonresolutions

{
  "terser": "3.14.1"
}

export 時

Cannot find module 'pages/_document'

now 用の設定でtarget: 'serverless'していたのでこれを削除で直った。

Error: Cannot export when target is not server. https://err.sh/zeit/next.js/next-export-serverless

next.config.jsでエクスポートしているオブジェクトにtarget: 'serverless'となっている可能性があります。静的ビルドの場合ここはtarget: 'server'(デフォルト値)が正解です。

値を変更後はnext buildnext exportと再度ビルドから行います。

JavaScript で飯食べたい歴約 5 年、 純( nju33 ) によるノートサイトです。

このサイトではドリンク代や奨学金返済の為、広告などを貼らせて頂いてますがご了承ください。

Change Log