Nw.js: nwjs 0.13.0-alpha1 - boot error [$5]

Created on 11 Jun 2015  ·  20Comments  ·  Source: nwjs/nw.js

Hello,
I'm trying to run the same app which works on 0.12 version.

When I try to lunch it I see an error (alert):

Impossible to load the extension: /private/var/folders/l2/6vtky5ps3_qg5w_jdsm9mwf80000gn/T/.com.myapp.kYvjFR. Invalid value for 'app.urls[0]': Missing scheme separator.

Console log
[0611/090930:INFO:nw_package.cc(174)] ./dist/osx/x64/MyApp.app/Contents/MacOS/MyApp
[3616:1799:0611/090932:ERROR:url_pattern_set.cc(240)] Invalid url pattern: chrome://print/*

OS: MacOS 10.8.5

There is a $5 open bounty on this issue. Add to the bounty at Bountysource.

bounty

Most helpful comment

@cbenjemia
To quote @b1rdex put node-remote to "node-remote": "http://< Something >"
Mine is "node-remote": "http://localhost"
In your package.json

All 20 comments

Same on Windows 7 here. The Dev SDK build is fine.

Ah it probably had something to do with your package.json. Remove stuff until it works. They changed something in the manifest. For me it was:
"node-remote": "*"
Removing that line in the manifest though just causes require to not work. Even if I do:
"node-remote": "localhost"
It still doesn't work. Either one causes the apps.url[0] error.

Looks related to this: https://github.com/nwjs/nw.js/issues/3359

Yeah when using node-remote I see:
Uncaught ReferenceError: require is not defined
Uncaught ReferenceError: nw is not defined

Referring to the line:
var gui = require('nw.gui');

Confirmed in v0.13.0-alpha3 on windows 10.

The problem is with node-remote package field.
In wiki description scheme was optional, but looks like it's required now.

So fix is to provide http:// or whatever you have scheme in node-remote field.

@rogerwang I think this is bug and should be reverted to previous behaviour.

I can confirm @b1rdex 's fix as working.

is there a solution until the fix ?

@cbenjemia
To quote @b1rdex put node-remote to "node-remote": "http://< Something >"
Mine is "node-remote": "http://localhost"
In your package.json

Any info when it will be fixed?

@HusainJaffer
Your suggestion:
"node-remote": "http://localhost"
Works perfectly fine. Thanks!

The node-remote spec is changed since 0.13.0. See migration notes from 0.12 to 0.13.

How to specify a "file" path for node-remote ?

This doesn't work: "node-remote": "file:///*"

I get "invalid scheme" error on startup (v0.13.0-beta2-win-x64)

This also doesn't work:

package.json:
"node-remote": ["https://*/*"],

var win = nw.Window.get();

nw.Window.open('https://www.google.co.uk', {}, function(new_win) {
  // do something with the newly created window
});

Then on the new window, open Dev tools and on Console type nw:

Uncaught ReferenceError: nw is not defined(…)

I do not understand why protocol scheme http:// or whatever should be mandatory supposed that I'm using local files only like

node-remote : 'index.html'

So, in v0.13.0-beta4 - http://nwjs.io/blog/v0.13.0-beta4/ this is not working (scheme separator needed), so I had to adopt

"node-remote" : "*://index.html"

This issue should be solved.

@AndryBray The spec of node-remote is changed to using match patterns. See the good and examples for details.

@Gimmeaphatbeat node-remote for "https://*/*" is working. And "file://*/* does NOT. But mostly local files inside your app can be specified using relative path. You don't have to use file:// scheme.

@ghostoy so we can use "node-remote" : "*://index.html"?

@loretoparisi It's not a valid pattern. If you want to match all index.html under any scheme and any host, use *://*/index.html.

@ghostoy still don't get how to make local files work .
"node-remote": "relative/path/to/file" does not work.

@lili21 node-remote is a pattern of a full URL. relative/path/to/file is not valid because it missed scheme and host name parts. See this document for the format of the pattern.

@ghostoy file scheme ? still not work.
"node-remote": "file:///src*"

I am using nw.js v0.14.7

@lili21 I see. Currently file: scheme with node is not supported.

Usually if HTML files are within the directory of your app, you don't have to use file: scheme and relative/path/to/file.html should be working without node-remote.

But if you are referencing files in absolute path, like /root/path/file.html, or paths in parents directories of your app, like ../path/to/file.html, it's not supported.

Some workarounds for you if your app is the second case:

  1. Refactor your app to contain all files within a same directory if possible. Or
  2. Host a local webserver and set node-remote in package.json. And refactor requests to file: by using http:.

Please also post your requirements here and we'll seek to support it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorty-zz picture sorty-zz  ·  4Comments

ezruneko picture ezruneko  ·  4Comments

Asp3ctus picture Asp3ctus  ·  4Comments

niutech picture niutech  ·  4Comments

rumax picture rumax  ·  4Comments