ignite-bowser icon indicating copy to clipboard operation
ignite-bowser copied to clipboard

Generated app doesn't compile for web (Module not found: Can't resolve './RCTNetworking')

Open magaman384 opened this issue 4 years ago • 11 comments

I have generated a new app using Ignite and Expo. After trying to compile it for web, it has failed with:

 web  Failed to compile. 
C:/<app_path>/node_modules/react-native/Libraries/Network/XMLHttpRequest.js 
Module not found: Can't resolve './RCTNetworking' in 'C:\<app_path>\node_modules\reactnative\Libraries\Network' error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Versions used:

  • Windows 7 64-bit Pro SP1
  • nodejs v10.15.3
  • yarn v1.22.4
  • expo-cli v3.15.4
  • ignite-cli v3.5.1

magaman384 avatar Mar 17 '20 17:03 magaman384

I have the same issue.

sean-m-oleary avatar Apr 14 '20 02:04 sean-m-oleary

Is anyone working on fixing this already? Just wondering... We're dead in the water here and can't even start to use Bower because of it.

sean-m-oleary avatar Apr 20 '20 20:04 sean-m-oleary

I found a work around. Since i use web part only for quick testing or debugging. I did the following to atleast run the app successfully on web.

Created a copy of reactotron.ts, named it reactotron.web.ts

Commented out the following section // hookup middleware if (this.config.useAsyncStorage) { Tron.setAsyncStorageHandler(AsyncStorage) } Tron.useReactNative({ asyncStorage: this.config.useAsyncStorage ? undefined : false, })

mariasamuel avatar May 19 '20 15:05 mariasamuel

Today I get the same issue, anyone, here who solved the issue?

amit00978 avatar Jul 15 '20 20:07 amit00978

I solved it.

First. you have to install "reactotron-react-js". Second. copy reactotron.ts to reactotron.web.ts and fix it to above comment by @mariasamuel . And fix import file "reactotron-react-native" to "reactotron-react-js" just like this

//import Tron from "reactotron-react-native"
import Tron from "reactotron-react-js"

maybe it will be work

s-kuniyoshi avatar Jul 26 '20 06:07 s-kuniyoshi

It works here. Thank @s-kuniyoshi.

ncperng avatar Sep 18 '20 10:09 ncperng

works for me too! Then i run into an error with the logo not loading... it's because on the web it doesn't play nice with [email protected] / [email protected] being referenced as just logo-ignite.png... so just copy [email protected] to logo-ignite.png and then it loads. :)

sean-m-oleary avatar Oct 15 '20 16:10 sean-m-oleary

works for me too! Then i run into an error with the logo not loading... it's because on the web it doesn't play nice with [email protected] / [email protected] being referenced as just logo-ignite.png... so just copy [email protected] to logo-ignite.png and then it loads. :)

@lanman2000 could you please explain what you mean by "just copy [email protected] to logo-ignite.png and then it loads." running into the same issue but don't know how to resolve it

jerrybuks avatar Dec 31 '20 17:12 jerrybuks

Isn't there any fix for those who want to generate all three platforms (web, android, ios) from the same source code?

parsa-ra avatar Jan 26 '21 12:01 parsa-ra

https://dev.to/expolovers/using-cross-tools-with-expo-web-and-native-3n81 https://medium.com/@sirpeas/intro-to-reactotron-setup-53047a7a2c6b

This will help

gruckionvit avatar Feb 02 '21 19:02 gruckionvit

I solved it.

First. you have to install "reactotron-react-js". Second. copy reactotron.ts to reactotron.web.ts and fix it to above comment by @mariasamuel . And fix import file "reactotron-react-native" to "reactotron-react-js" just like this

//import Tron from "reactotron-react-native"
import Tron from "reactotron-react-js"

maybe it will be work

Which reactotron.ts file do you mean?