Closed2
Next.js v13.1 にて、next-transpile-modules はネイティブに移行
v12からv13へアップデートによる、Build Error
build: > Build error occurred
build: TypeError: Cannot read properties of undefined (reading 'and')
build: at Object.webpack (/Users/products/node_modules/next-transpile-modules/src/next-transpile-modules.js:201:60)
build: at Object.getBaseWebpackConfig [as default] (/Users/products/node_modules/next/dist/build/webpack-config.js:1446:32)
build: at async Promise.all (index 0)
build: at async Span.traceAsyncFn (/Users/products/node_modules/next/dist/trace/trace.js:79:20)
build: at async /Users/products/node_modules/next/dist/build/index.js:483:33
build: at async /Users/products/node_modules/next/dist/build/index.js:467:13
build: at async Span.traceAsyncFn (/Users/products/node_modules/next/dist/trace/trace.js:79:20)
build: at async Object.build [as default] (/Users/products/node_modules/next/dist/build/index.js:66:29)
build: error Command failed with exit code 1.
build: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
build: Error: command finished with error: command (typescript/apps/moet) yarn run build exited (1)
公式の移行ガイド
移行ガイド
Nextv13.1以降では、next-transpile-modules
をimportしないで、ネイティブのtranspilePackages
を使用する
-const withTM = require('next-transpile-modules')(['awesome_module']);
-module.exports = withTM({});
+module.exports = {
+ transpilePackages: ['awesome_module'],
+};
このスクラップは2023/03/06にクローズされました