Builds and Pipelines

Next.js ChunkLoadError: Loading chunk failed after deploying.

Everything was working fine locally, but the whole console gets red with ChunkLoadError after you deploy to production. Moreover, the frontend becomes blank white and you see Application error: a client-side exception has occurred (see the browser console for more information). The issue seems to be here for a while, and it looks like no-one knows which part exactly is responsible for the error (Next.js or Webpack or both), but the workaround is present.

Next.js ChunkLoadError: Loading chunk failed after deploying. Read More »

(0 , _genMapping.maybeAddMapping) is not a function

You run yarn start or yarn dev and you see the error below? Neither running yarn install, nor using a different Node version helps?

Web Bundling complete 2068ms
./index.js
Module build failed (from ./node_modules/@expo/webpack-config/node_modules/babel-loader/lib/index.js):
TypeError: /x/index.js: (0 , _genMapping.maybeAddMapping) is not a function
    at SourceMap.mark (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/source-map.ts:150:20)
    at Buffer._mark (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/buffer.ts:308:16)
    at Buffer._append (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/buffer.ts:281:12)
    at Buffer.append (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/buffer.ts:153:10)
    at Generator._append (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/printer.ts:413:15)
    at Generator.word (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/printer.ts:230:10)
    at Generator.ImportDeclaration (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/generators/modules.ts:239:8)
    at Buffer.exactSource (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/buffer.ts:426:5)
    at Generator.exactSource (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/printer.ts:354:15)
    at Generator.print (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/printer.ts:686:10)
    at Generator.printJoin (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/printer.ts:798:12)
    at Generator.printSequence (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/printer.ts:900:10)
    at Generator.Program (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/generators/base.ts:31:8)
    at Generator.exactSource (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/printer.ts:348:7)
    at Generator.print (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/printer.ts:686:10)
    at Generator.File (/x/node_modules/@expo/webpack-config/node_modules/@babel/generator/src/generators/base.ts:11:8)

(0 , _genMapping.maybeAddMapping) is not a function Read More »

[!] RollupError: Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to “.cjs” or pass the “–bundleConfigAsCjs” flag.

[!] RollupError: Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to “.cjs” or pass the “–bundleConfigAsCjs” flag. Read More »