[Bundling failed]: node_modules/@expo-google-fonts/dev/index.js: Maximum call stack size exceeded
I just found out expo-google-fonts/dev and added to my code import { Inter_600SemiBold } from '@expo-google-fonts/dev'. Now, when building my expo app on launch, the following error is raised:
Android Bundling failed 10115ms
node_modules/@expo-google-fonts/dev/index.js: /home/hb/Dev/MyAppName/app/node_modules/@expo-google-fonts/dev/index.js: Maximum call stack size exceeded
RangeError: /home/hb/Dev/MyAppName/app/node_modules/@expo-google-fonts/dev/index.js: Maximum call stack size exceeded
at PluginPass.ReferencedIdentifier (/home/hb/Dev/MyAppName/app/node_modules/@babel/helper-define-polyfill-provider/lib/visitors/usage.js:20:25)
at PluginPass.newFn (/home/hb/Dev/MyAppName/app/node_modules/@babel/traverse/lib/visitors.js:218:17)
at newFn (/home/hb/Dev/MyAppName/app/node_modules/@babel/traverse/lib/visitors.js:177:21)
at NodePath._call (/home/hb/Dev/MyAppName/app/node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/home/hb/Dev/MyAppName/app/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/home/hb/Dev/MyAppName/app/node_modules/@babel/traverse/lib/path/context.js:90:31)
at TraversalContext.visitQueue (/home/hb/Dev/MyAppName/app/node_modules/@babel/traverse/lib/context.js:103:16)
at TraversalContext.visitSingle (/home/hb/Dev/MyAppName/app/node_modules/@babel/traverse/lib/context.js:77:19)
at TraversalContext.visit (/home/hb/Dev/MyAppName/app/node_modules/@babel/traverse/lib/context.js:131:19)
did u figure it out? same problem
No :/ I had to install all the fonts I wanted to try out, then removed the ones I didn't like :P
how do you do that? and does that fix the problem?
Let's say I wanted to try the 'inter' font. So, as readme says, expo install @expo-google-fonts/inter and try it out. It fixes the problem as I am no longer using the @expo-google-fonts/dev, but the individual and local fonts, not downloading them on the go.
i see what u mean. i figured out how to fix it by going in the index.js file and deleting the fonts I did not want
That's a simple and a clever solution! I also thought previously that the 6k file with its exports was causing the problem, but hadn't the idea of cleaning it. I am curious on how the author are going to fix it (and to know what is causing the error). Maybe using js Proxy somehow? JSON? Regex?
I'm not sure what the problem is here. I'll try to investigate soon. If anyone figures out what's going on here and how to fix it in the meantime, contributions are welcome.
Had this problem for weeks, thanks for the fix. Importing directly not using /dev worked. ^^