Attempting to open a NW in Webstorm for debugging purposes, but encountering an issue. When there is an error in the app, the NW window simply closes without providing any indication of what went wrong.
Stumbled upon this helpful article on the Webstorm website. In my root folder, I have app.js which includes the usual Express app setup and module inclusion. Additionally, I have a package.json:
{
"name": "nw",
"version": "1.0.0",
"description": "",
"main": "index.html",
"node-main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"window": {
"toolbar": true,
"width": 800,
"height": 500
},
"license": "ISC",
"dependencies": {
"jquery": "^2.1.4",
"nw": "^0.12.2",
"pretty-bytes": "^1.0.2"
}
}
Alongside that, I have the following index.html file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<title>My App</title>
<script src="app.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
window.location = 'http://localhost:3000';
</script>
</body>
</html>
Encountering two main issues here:
When attempting to run NW alone (simply double clicking nw.exe), the app will launch but not consistently. It closes unexpectedly about 30% of the time.
Following the instructions provided by Webstorm for debugging, I experience strange results. When trying to open it within Webstorm, the NW window appears briefly before closing with the error message: Process finished with exit code 0. However, I can still open the application in regular mode outside of debug mode.
Confused by these issues and seeking insight. My Webstorm debug screen: https://i.sstatic.net/oTGxH.png