React Native: DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script a
Asked Answered
S

4

5

I am continuously running into this error while trying to learn react native. The app will run fine and then I make some additions and it breaks and shows this error:

error message

The code that is producing it is:

import React from 'react';
import {StyleSheet, View, Text} from 'react-native';

const App = () => {
  return (
    <View>
      <Text>Hello</Text>
    </View>
  );
};

const styles = StyleSheet.create({});

export default App;

Any information would be awesome, I just want a consistent dev environment to be able to work in. I have looked through similar posts however they all seem to already have functioning projects when receiving this error.

Screwy answered 19/10, 2020 at 9:23 Comment(0)
S
4

The fix is that it was a problem with the react-native debugger that apparently just happens sometimes, disable the debugger with ctr+m on the android device and debug using node command line or third party debugger

Screwy answered 20/10, 2020 at 23:5 Comment(0)
D
2

Running below command fixed the issue for me.

cd android
./gradlew clean
Debatable answered 30/12, 2021 at 10:7 Comment(0)
C
0

I have faced similar issue. Apparently, my react native debugger is trying to reference a module from previous react native folder. (That time, I created 2 same react native folder, one as a backup. In case I messed up with the coding)

In order to fix this, I have to clear the react native cache. I found my answer in this post.

Cacomistle answered 18/9, 2021 at 13:32 Comment(0)
B
0

I had the same error in debug mode. The problem for me was that I had VPN turned on and my phone was not able to connect to React Native Debugger (on the same Wi-Fi).

Failed to execute 'importScripts' on 'WorkerGlobalScope':
The script at *http://192.168.88.104:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.squirrel.walnutsdev'
failed to load.
Broadloom answered 12/9 at 10:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.