react-native-vector-icons
react-native-vector-icons copied to clipboard
Import fails with "Failed to execute 'ImportScripts' on 'WorkerGlobalScope'"
I've just started a new react-native project (using the normal cli, not expo). I have installed this package using yarn:
yarn add react-native-vector-icons
react-native link
...which seemed to be successful, but when I import the package (just the import, not even using it yet), I get the following error.
e.g.:
import Icon from 'react-native-vector-icons/FontAwesome'
I've tried uninstalling, unlinking, re-doing the install etc... no luck. I then also tried to add that gradle line to apply the plugin, as per the README, but that didn't change anything.
Any ideas?
I have same problem. For latest react-native version (0.53) , you need delete this
rm node_modules/react-native/local-cli/core/__fixtures__/files/package.json
This solved for me.
you need delete this
rm node_modules/react-native/local-cli/core/__fixtures__/files/package.json
Yes, that's what I now found out as well. I don't know if it's a bug with react-native or the vector icons one, but it's a hassle.
For now, I have made the rm
command (adding a -f
switch) as a postinstall script in my project.
rm node_modules/react-native/local-cli/core/__fixtures__/files/package.json
yes,this success for me
just close debugging tab in your browser and turn off Debug JS Remotely
For future people that come across this.
This issue occurs because you are trying to serve an offline bundle and debug it in the browser. If you used npm run build:ios to generate your bundle it probs is offline. Thus when you run react-native run-ios you your thing works. But as soon as you debug js remotely it fails because it's an offline-only bundle. So make sure you do npm start -- --reset-cache to serve a dynamically generated bundle.
Stop your bundler and restart it. It worked for me.
expo 40, same issue.
Hello guys, I started getting this problem after updating Expo to version 40, resetting the cache didn't work.
expo 40 same problem
My problem was a wrong import, I did it right and restarted the app, then it ran.
This error was caused by port 19001 busy for my pc. You can find out which application is occupying the required port from Resource Monitor. This method may work for you too
Stop your bundler and restart it. It worked for me.
worked for me !
Stop your bundler and restart it. It worked for me.
Works for me!
just close debugging tab in your browser and turn off Debug JS Remotely
worked for me, just close debugger on browser .
hei guys,i think i found the reason. when open Debug Js Remotely, your jsbundle will executed in worker of chrome. any jsbundle runtime error will cause the 'importscripts' error. the only debugger method is check 'pause on caughted exceptions' on chrome.
if it works for you when turn off Debug JS Remotely, like me. the reason may be calling synchronous methods on native modules.
good luck.
For future people that come across this.
This issue occurs because you are trying to serve an offline bundle and debug it in the browser. If you used npm run build:ios to generate your bundle it probs is offline. Thus when you run react-native run-ios you your thing works. But as soon as you debug js remotely it fails because it's an offline-only bundle. So make sure you do npm start -- --reset-cache to serve a dynamically generated bundle.
I accidentally set this field to offline, and your solution reminded me of it. thank you
I realized i had 'react-native-maps' imported somewhere in my app, after i uninstalled it. 🥲
See thread for fixes in particular https://github.com/oblador/react-native-vector-icons/issues/662#issuecomment-568942068