node webkit app-view permissions - node-webkit

I have a backbone web app and everything works fine in my browser. Now I want to make a .exe with Node webkit.
This is my package.json file:
{
"name": "XXXX",
"main": "index.html",
"window": {
"toolbar": true,
"width": 800,
"height": 600
},
"single-instance": false,
"version": "1alpha",
"private": true
}
but when I execute the program I obtain these message in the js console:
You do not have permission to use the appview element. Be sure to declare the 'appview' permission in your manifest file and use the --enable-app-view command line flag.
I've been how to fix it here but I didn't find any solution.
Any idea? thanks

I have find any partial solution. If a change the main option to:
"main": "http://localhost:8000",
it works perfectly, but I need to start a little web server before and I don't want to do that. Any idea?

Related

VSCode Debug and Jest: No breakpoints running with npm, CWD error running with node

I am trying to get breakpoints to hit in Jest Debug for VS Code.
This launch config runs but does not hit breakpoints:
{
"type": "node",
"request": "launch",
"name": "Test",
"runtimeExecutable": "npm",
"runtimeArgs": ["test"],
"port": 9229
}
This launch config does not run, but it looks like it hits breakpoints.
It opens fs.js at a debugger breakpoint with this error:
Error: ENOENT: no such file or directory, access 'node_modules/jest-cli/bin/package.json'
Like it's looking for the workspace's package.json file inside the jest bin directory.
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
For me the solution was that inside VSCodes Debugging Panel inside the Breakpoints section, I had All Exceptions checked. Unchecking this allowed the debugger to work as I expected.
Also the issue did not happen when checking the Uncaught Exceptions Breakpoint handler. All Exceptions actually catches all not just inside your but also inside others code, regardless if they are handled or not.
I had a package.json file one directory up. I deleted it, but still got the same error. I fixed it by copying it to a new directory further up on my path, I believe so VS Code could detect it was a new workspace.

Debug vue-cli 3 generated app from Visual Studio Code

I generated an app using vue-cli 3.0.0-rc.3
Now I want to debug it using Visual Studio Code (Debugger for Chrome) however I can't seem to find the option to turn on sourceMaps.
I set the breakpoint in VSCode but it is not hit.
If I specify: "sourceMaps: true" in vue.config.js, I got an error "Invalid options in vue.config.js: "sourceMaps" is not allowed"
What option needs to be set for debugging to work?
According to the Official cookbook these steps needs to be done:
vue.config.js file has to be edited and add:
module.exports = {
configureWebpack: {
devtool: 'source-map'
}
}
then launch.json should look like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "vuejs: chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}/src",
"breakOnLoad": true,
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
}
]
}
After these steps breakpoints started to work as expected.
In addition to the above, I also had to follow the steps in this post: Visual Studio Code breakpoint appearing in wrong place
In particular, setting the sourceMapPathOverrides property. Finally got my breakpoints to work in Visual Studio Code using Vue.js. :)

There is no 'package.json' - node-webkit app

I'm making my first desktop application using node-webkit.
I followed all the steps to package the app on windows but I'm getting this error:
There is no 'package.json' in the package, please make sure the 'package.json' is in the root of the package.
Although the package is in the root.
sample package.json file
{
"name": "name of app",
"version": "1.0.0",
"main": "index.html",
"single-instance": true,
"node-remote": "<local>",
"window": {
"title": "name to show in title bar",
"icon": "icon to show in titlebar",
"position": "center",
"min_width": 1024,
"min_height": 600,
"toolbar": true,
"width": 1362,
"height": 768
},
"dependencies": {
"express": "3.x"
},
"webkit": {
"plugin": true
}
}
Ok I found my mistake. In fact, I was compressing the folder containing the package json and the other files. So what I made was like that:
App.zip
|
|-App
|-package.json
|-Other files
What is correct is this:
App.zip
|-package.json
|-Other files

window.print can't work in node-webkit

I hava a web project with express. when I convert the project to node-webkit use package.json
{
"name": "hello"
"main": "http://localhost:3001",
"node-main": "index.js",
"window": {
"toolbar": false,
"frame": true,
"width": 1170,
"height": 780
},
...
}
it can work well. but there is a button in one page, it will call window.print() on click and now it can't work in node-webkit application.
Any idea about what I am doing wrong? or are there any other solution to print the page?

Having trouble packaging node webkit app

I wrote a small app in node webkit, and am having trouble packaging it. My eventual goal is to have a .exe that I can give to other people.
I can run it from the command line with "nodewebkit".
I've tried zipping the files and saving the result as app.nw, but when I try to run that I just get the default node webkit screen. I've read through the docs on rogerwang github, but haven't gotten anywhere because I can't get through that first step.
The app consists of a few files: index.html, main.js, styles.css. It depends on a few node modules as well as jquery. The package.json file is pasted below... any suggestions would be much appreciated.
{
"name": "spl",
"version": "0.0.0",
"description": "",
"keywords": [],
"main": "index.html",
"homepage": "https://github.com/lpappone/spl",
"bugs": "https://github.com/lpappone/spl/issues",
"window": {
"title": "Splitter",
"toolbar": false,
"frame": true,
"width": 800,
"height": 500
},
"author": {
"name": "Lauren Pappone",
"email": "",
"url": "https://github.com/lpappone"
},
"repository": {
"type": "git",
"url": "git://github.com/lpappone/spl.git"
},
"dependencies": {
"fast-csv": "^0.5.3",
"recursive-readdir": "^1.2.0"
},
"devDependencies": {},
"engines": {
"node": ">=0.8.0"
}
}
The directory structure looks like this, and when I inspect the contents of the .nw, it is exactly the same:
You seem to be doing this on a Mac, so I'll cover that. Windows and Linux are slightly more complicated because they don't have App Bundles the way Mac OSX does.
Are you copying your app.nw to the right place? Are you sure you're including everything in app.nw?
Is this what you're doing?:
First you need to create app.nw, which is just a zip file of your entire project. If you go to your project dir (the one containing package.json) you can do this by typing
zip -r ../app.nw .
Now create a copy of node-webkit.app and copy app.nw into node-webkit.app/Contents/Resources/
cp app.nw node-webkit.app/Contents/Resources/
You should be able to run node-webkit.app now and it should run your app. (You might have some issues with security settings and such)
See https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps#mac-os-x for further details.