Closed mparker11 closed 6 years ago
I need to update the README, but I no longer support checking on the browser.
This is because you can not use the NW.js API (nw.) or the Chrome Extension API (chrome.) on the browser.
Therefore, development should be done in the window opened with npm start
.
Thanks.
@naviapis Thank you for that! I just hit another config question: I'm trying to use React Router but I can't seem to get the starting route to simply be /
(which will be my home page). I found the line in package.json where the starting url is index.html
but when I changed it to /
, I got this Chrome error:
The webpage at chrome-extension://flimcfogogbacdgkdhpbncbjhmdfhnlm/ might be temporarily down or it may have moved permanently to a new web address.
How can I mimic the beginning route as if I were starting at localhost:3000/
?
I figured out to put /index.html
in my route's config. Pretty simple fix smh. However, I'm still curious about the architecture where there must be /index.html attached the to route. Any insight on that?
The main setting of package.json is the endpoint file path used in NW.js.
There is a related example project. Create NW.js React App ejected + React router + Redux + Redux saga https://github.com/naviapps/nw-react-boilerplate Routes https://github.com/naviapps/nw-react-boilerplate/blob/master/src/routes.js
It is not necessary to eject.
Ok, great. That's what I ended up figuring out. Thanks so much for the responses!
The default URL of NW.js seems to be chrome-extension: //********/index.html
.
NW.js probably gets the main
in package.json as the file path.
I think this is similar to the URL when the local file was opened in the browser.
file:///Users/Guest/my-app/index.html
However, it should be possible to display even here.
file:///Users/Guest/my-app/
Close comment. Thanks.
I'm pretty fresh on this project and I've barely added anything, but I'm getting
Uncaught ReferenceError: require is not defined
when doingnpm start
. I've tracked this down to thewebpack-dev-server
package, line 1. With this problem, I am not able to view my project in my regular browser using localhost:3000. Does anyone know how this can be fixed without ejecting?