Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nwjs 0.13.0-alpha1 - boot error [$5] #3571

Closed
AndryBray opened this issue Jun 11, 2015 · 20 comments

Comments

Projects
None yet
@AndryBray
Copy link

commented Jun 11, 2015

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.

@sirisian

This comment has been minimized.

Copy link

commented Jun 15, 2015

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: #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');

@b1rdex

This comment has been minimized.

Copy link

commented Sep 15, 2015

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.

@b1rdex

This comment has been minimized.

@mitchross

This comment has been minimized.

Copy link

commented Sep 25, 2015

I can confirm @b1rdex 's fix as working.

@cbenjemia

This comment has been minimized.

Copy link

commented Sep 30, 2015

is there a solution until the fix ?

@HunterJaffer

This comment has been minimized.

Copy link

commented Oct 12, 2015

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

@tiitremmel

This comment has been minimized.

Copy link

commented Nov 11, 2015

Any info when it will be fixed?

@rogerwang rogerwang changed the title nwjs 0.13.0-alpha1 - boot error nwjs 0.13.0-alpha1 - boot error [$5] Nov 13, 2015

@rogerwang rogerwang added the bounty label Nov 13, 2015

@hammadasad

This comment has been minimized.

Copy link

commented Jan 5, 2016

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

@ghostoy

This comment has been minimized.

Copy link
Member

commented Jan 5, 2016

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

@Gimmeaphatbeat

This comment has been minimized.

Copy link

commented Jan 5, 2016

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)

@Gimmeaphatbeat

This comment has been minimized.

Copy link

commented Jan 5, 2016

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(…)

@loretoparisi

This comment has been minimized.

Copy link

commented Jan 26, 2016

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"

@rogerwang rogerwang added this to the 0.13.x milestone Apr 11, 2016

@ghostoy

This comment has been minimized.

Copy link
Member

commented Apr 13, 2016

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.

@loretoparisi

This comment has been minimized.

Copy link

commented Apr 13, 2016

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

@ghostoy

This comment has been minimized.

Copy link
Member

commented Apr 13, 2016

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

@rogerwang

This comment has been minimized.

Copy link
Member

commented Apr 18, 2016

close per #3571 (comment)

@rogerwang rogerwang closed this Apr 18, 2016

adamhurst pushed a commit to adamhurst/karma-nodewebkit-launcher that referenced this issue Jun 14, 2016

@lili21

This comment has been minimized.

Copy link

commented Nov 11, 2016

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

@ghostoy

This comment has been minimized.

Copy link
Member

commented Nov 14, 2016

@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.

@lili21

This comment has been minimized.

Copy link

commented Nov 14, 2016

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

I am using nw.js v0.14.7

@ghostoy

This comment has been minimized.

Copy link
Member

commented Nov 14, 2016

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.