(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)

Here’s an easy fix… Delete node_modules completely and run yarn install again. And now it works…


Did you know that I made an in-browser image converter, where you can convert your images without uploading them anywhere? Try it out and let me know what you think. It's free.

Leave a Comment

Your email address will not be published. Required fields are marked *