Skip to content

React Dev Tools cannot find variable window #63

Description

@heritiermwalila

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,
});`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions