Tord Larsen
Tord Larsen

Reputation: 2836

WebStorm React Native cant start debug

I get this error starting the debug session. I have never used WebStorm before and following the setup from JetBrains

"C:\Program Files\JetBrains\WebStorm 2018.2.6\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" --inspect-brk=51768 L:\react\PropertyFinder\PropertyFinder\index.js
Debugger listening on ws://127.0.0.1:51768/b33603e7-c88c-4336-b4d1-6042b064fcb0
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
L:\react\PropertyFinder\PropertyFinder\index.js:1
(function (exports, require, module, __filename, __dirname) { import {AppRegistry} from 'react-native';
                                                                     ^

SyntaxError: Unexpected token {
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:656:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
Waiting for the debugger to disconnect...

Process finished with exit code -1073741510 (0xC000013A: interrupted by Ctrl+C)

Here´s the Index.js

/** @format */

    import {AppRegistry} from 'react-native';
    import App from './App';
    import {name as appName} from './app.json';

    AppRegistry.registerComponent(appName, () => App);

Any idea? Looks like there a problem at index.js:1 but what?

Upvotes: 0

Views: 165

Answers (1)

lena
lena

Reputation: 93758

You should use React Native run configuration to start your application - see Help instructions and blog post. I don't understand what you meant to accomplish when starting your index.js with Node.js

Upvotes: 2

Related Questions