Open neeteshraj opened 3 months ago
same issue
@maksim-romanov did you find any solutions?
I got the same issue running this recipe but with npm instead of bun https://ignitecookbook.com/docs/recipes/Authentication/
Using Ignite 9.7.1
npx ignite-cli@latest new AuthRecipe --workflow=cng --remove-demo --git --install-deps --packager=npm
✅ What bundle identifier? · com.authrecipe
✅ Where do you want to start your project? ·
After installing I ran:
npm run ios
This then gives the following failure:
› Installing on iPhone 15 Pro Max
› Opening on iPhone 15 Pro Max (com.authrecipe)
› Opening exp+authrecipe://expo-development-client/?url=http%3A%2F%2F192.168.1.182%3A8081 on iPhone 15 Pro Max
› Logs for your project will appear below. Press Ctrl+C to exit.
iOS Bundled 20212ms node_modules/expo/AppEntry.js (1698 modules)
(NOBRIDGE) LOG Bridgeless mode is enabled
(NOBRIDGE) WARN getHost: "Invalid non-string URL" for scriptURL - Falling back to localhost
iOS Bundled 116ms node_modules/expo/AppEntry.js (1 module)
(NOBRIDGE) LOG Bridgeless mode is enabled
(NOBRIDGE) WARN getHost: "Invalid non-string URL" for scriptURL - Falling back to localhost
I have noticed that in node_modules/reactotron-react-native/src/reactotron-react-native.ts there is this snippet.
const getHost = (defaultHost = "localhost") => {
try {
// RN Reference: https://github.com/facebook/react-native/blob/main/packages/react-native/src/private/specs/modules/NativeSourceCode.js
const scriptURL = NativeModules?.SourceCode?.getConstants().scriptURL
if (typeof scriptURL !== "string") throw new Error("Invalid non-string URL")
return getHostFromUrl(scriptURL)
} catch (error) {
console.warn(`getHost: "${error.message}" for scriptURL - Falling back to ${defaultHost}`)
return defaultHost
}
}
When you inspect it, you can see that NativeModules is an empty object {}
, thus no SourceCode and no getConstants function. It is this section that is causing the error to be thrown.
Not sure I have the right file but the React Native code that is referenced was last changed 6 months ago and it looks to use new architecture.
I'm going to try with turning new architecture off and see how far I get.
is there any update about this issue?
is there any update about this issue?
i solved it very quickly.
i was installing pods with RCT_NEW_ARCH_ENABLED=1 pod install
, and getting that error when app starts everytime.
i installed pods without new arch and problem solved. so, just do pod install
in ios folder and try to start app just like that.
Is there any solutions with the new arch enabled?
I tried using this react native url polyfill to see if that worked but it didn't (or I didn't implement it correctly). Moving to the old architecture worked though. Not a long term possibility though.
Hey folks, looks like the interface we were using here no longer exists in new arch. I was hoping this was a simple fix I could do while we were at Chain React Conf.
Looks like it will be more involved. Stay tuned.
any update for the new arch?
@mark and I went over this last week. I got him up to speed with my research on the topic. Unfortunately, I haven't had a spare moment to work on it.
We feel the same pain as we prepare our applications for the new arch.
lol Wrong Mark, @morganick :P
Thanks for the trace @adamsinnott. We're going to have to figure out where this variable lives in the new architecture. I'm on a deadline crunch right now but can probably look into this after.
For now, i've silenced the warning with:
if (__DEV__) {
LogBox.ignoreLogs([
'getHost: "Invalid non-string URL" for scriptURL - Falling back to localhost',
])
}
Workaround for ignoring warning.
const _ = console.warn;
console.warn = () => {};
LogBox.ignoreLogs(['Invalid non-string URL']);
const Reactotron = require('reactotron-react-native').default;
console.warn = _;
Describe the bug
I am getting this error in development.
getHost: "Invalid non-string URL" for scriptURL - Falling back to localhost
.Steps to reproduce. Create RN app. I am in ios with new architecture enabled. This is the reactoronConfig.ts file import Reactotron, {openInEditor, ReactotronReactNative} from 'reactotron-react-native'; import mmkvPlugin from 'reactotron-react-native-mmkv'; import {reactotronRedux} from 'reactotron-redux'; import {storage} from './store';
import config from '../app.json';
Reactotron.configure({ name: config.name, }) .useReactNative({ networking: { ignoreUrls: /symbolicate/, }, editor: false, errors: {veto: stackFrame => false}, overlay: false, }) .use(openInEditor()) .use(mmkvPlugin({storage}))
.use(reactotronRedux())
.connect();
export default Reactotron; and this is the index.js /**
import {AppRegistry} from 'react-native'; import App from './App'; import {name as appName} from './app.json'; import 'react-native-gesture-handler';
if (DEV) { import('@/reactotron.config'); } AppRegistry.registerComponent(appName, () => App);
Reactotron version
5.1.7