You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am debugging a React Native application in Google Chrome, but I've noticed that I get a lot of "undefined" errors when I try and run functions, or variables, in the Console. Even though they are actually defined, and within scope.
I may have a file which looks something like this:
import { store } from '../store';
import { createField } from '../fields';
export function foo() {
return 123;
}
export function bar() {
return 456; // breakpoint here
}
When I am stopped at a breakpoint in bar(), and I enter foo() in the Console, I get the following error:
VM163:1 Uncaught ReferenceError: foo is not defined
at eval (eval at bar (main:105), <anonymous>:1:1)
at bar (main.js:105)
at Screen.navigationOptions (Screen.js:26)
at applyConfig (createConfigGetter.js:28)
at Object.getScreenOptions (createConfigGetter.js:88)
at Object.getScreenOptions (createConfigGetter.js:73)
at Object.getScreenOptions (createConfigGetter.js:73)
at DrawerView.render (DrawerView.js:153)
at finishClassComponent (ReactNativeFiber-dev.js:1721)
at updateClassComponent (ReactNativeFiber-dev.js:1713)
The same error occurs when I enter store, or createField().
Is this some sort of configuration issue in the React Native project, or scope issue in the JavaScript?
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 8.4.0
Yarn: Not Found
npm: 5.3.0
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found
When I am at a breakpoint in a JS file, I would expect to be able to call functions defined within it, as well as be able to inspect variables which are in scope.
Actual Behavior
ReferenceError errors when trying the aforementioned.
The text was updated successfully, but these errors were encountered:
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest stable release?
I am debugging a React Native application in Google Chrome, but I've noticed that I get a lot of "undefined" errors when I try and run functions, or variables, in the Console. Even though they are actually defined, and within scope.
I may have a file which looks something like this:
When I am stopped at a breakpoint in
bar()
, and I enterfoo()
in the Console, I get the following error:The same error occurs when I enter
store
, orcreateField()
.Is this some sort of configuration issue in the React Native project, or scope issue in the JavaScript?
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 8.4.0
Yarn: Not Found
npm: 5.3.0
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.0.0-beta.5 => 16.0.0
react-native: ^0.49.5 => 0.49.5
Expected Behavior
When I am at a breakpoint in a JS file, I would expect to be able to call functions defined within it, as well as be able to inspect variables which are in scope.
Actual Behavior
ReferenceError errors when trying the aforementioned.
The text was updated successfully, but these errors were encountered: