q3e / react-native-github-graphql-app

React Native App that searches github projects and their contributors[WIP]
MIT License
2 stars 0 forks source link

Error when using FlatList: Failed to execute 'importScripts' on 'WorkerGlobalScope #3

Closed q3e closed 7 years ago

q3e commented 7 years ago

I get this error when I import flatList into my react-native app. When I have FlatList as an import: import { Text, FlatList } from 'react-native'

from the expo simulator screen

img_20171029_083459

abi21_0_0.com.facebook.react.common .JavascriptException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://1 92.1 68.0.1 3:19001/ node_modules/react-native-scripts/ 

build/bin/crna-entry.bundle? platform=android&dev=true&strict=false&min 

ify=false&hot=false&assetPlugin=expo/tools/ hashAssetFiles' failed to load. 

Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http:// 192.168.0.13:19001/node_modules/reactnative-scripts/build/bin/crna-entry.bundle? platform=android&dev=true&strict=false&min ify=faIse&hot=false&assetPlugin=expoltoolsl hashAssetFiles' failed to load. 

loadApplicationScript WebsocketJavaScriptExecutor.java:173 

run NativeRunnable.java

Something like this facebook/react-native#13558 and this https://github.com/facebook/react-native/issues/6035

q3e commented 7 years ago

https://stackoverflow.com/questions/46997358/error-when-rendering-flatlist-with-default-props-failed-to-execute-importscript

q3e commented 7 years ago

fixed by changing the renderItem prop

          data={responseData}
          renderItem={({item}) => <Text >{item.node.nameWithOwner}</Text>}
        />

https://stackoverflow.com/questions/46997358/error-when-rendering-flatlist-with-default-props-failed-to-execute-importscript

q3e commented 7 years ago

With his error, you are almost sure it's an issue with your export or import statements... e.g check any file you might have exported or default exported twice...

q3e commented 6 years ago

https://github.com/react-community/create-react-native-app/issues/401

PeterHassaballah commented 4 years ago

Try restarting your metro bundler .