-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Dev Tools cannot find variable window #63
Comments
What version of react-nativescript is this? Could you also show your Webpack config? |
"react": "^16.13.1", `const { join, relative, resolve, sep } = require("path"); const webpack = require("webpack"); module.exports = env => {
}; |
The last time I set up React Devtools was with this version:
Are you using a newer version of the Devtools? And incidentally does that older version work? |
I believe that the older
This might not work, still. There is a high possibility that the latest React Devtools uses some Window APIs that don't exist on the NativeScript If that doesn't work, I'd recommend falling back to |
@shirakaba I've downgraded to the |
@heritiermwalila Strange. Have you also tried applying the extra webpack define (where |
@heritiermwalila Actually, I've found the git branch where I originally got all this working – this bit looks important. Try adding these lines to your react-nativescript/sample/app/app.ts Lines 30 to 33 in 83bcada
|
file: node_modules/react-devtools-core/dist/backend.js:1:220: JS ERROR ReferenceError: Can't find variable: window
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: ReferenceError: Can't find variable: window
`import 'nativescript-websockets'; // Import for side-effects.
import * as React from "react";
Object.defineProperty(global, 'WebSocket', {
value: (global as any).WebSocket
});
/* Controls react-nativescript log verbosity. true: all logs; false: only error logs. */
Object.defineProperty(global, 'DEV', { value: false });
const { connectToDevTools } = require('react-devtools-core');
connectToDevTools({
host: 'localhost',
port: 8097,
resolveRNStyle: null,
isAppActive: () => true,
});`
The text was updated successfully, but these errors were encountered: