question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relative path to HTML file no longer works (package.json - main)

See original GitHub issue

Hello.

First things first: NWJS: 13.0 x64 DEV and 13.2 x64 DEV OS: Win 10 Home x64

Relative path to main HTML file cannot be used anymore. It was working fine on 0.12.3 but now I must do one of two things:

  1. put main HTML together with package.json
  2. set absolute path to main HTML in package.json->main (not an option for me).

If I try to use relative path, then I get:

Nie znaleziono pliku (File not found)

Mógł zostać przeniesiony lub usunięty. (It could be moved or deleted.) ERR_FILE_NOT_FOUND

I believe it is not intended behavior because I haven’t found this in documentation.

Files structure

PROJECT_ROOT
    ┣ NWJS
    ┃ ┗ package.json
    ┣ start.html
    ┗ start.bat

package.json

{

    "main": "../start.html",

    "name": "AppName",
    "description": "",
    "version": "1",

    "nodejs": true,

    "window": {
        "title": "app title",
        "icon": "",
        "frame": true,
        "width": 920,
        "height": 520,
        "position": "center"
    },

    "webkit": {
        "plugin": false
    },

    "chromium-args": "--data-path='NWJS/Storage' --user-data-dir='NWJS/User data'"

}

start.bat

@echo off
cd /d %~dp0
start "" "..\..\bin\0.13.2 SDK\x64\nw.exe" "%cd%/NWJS" %*

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
rogerwangcommented, Mar 24, 2017

will add a command line flag to specify project root.

1reaction
Leprosycommented, Mar 23, 2017

I’m having the same issue…is this going to be solved in some way?

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Relative path in index.html after build - Stack Overflow
I'm using Photino.io building React JS to create UI for .NET cross-platform apps & the package.json was not using this so it couldn't...
Read more >
Path | Node.js v19.3.0 Documentation
The node:path module provides utilities for working with file and directory paths. It can be accessed using: const path = require('node:path'); ...
Read more >
rollup.js
So far, we've created a simple bundle from an entry point and a module imported via a relative path. As you build more...
Read more >
Documentation - Module Resolution - TypeScript
Ask the folder /root/src/moduleB if it contains a file named package.json that specifies a "main" module. In our example, if Node.js found the...
Read more >
package.json - npm Docs
This should be a module relative to the root of your package folder. For most modules, it makes the most sense to have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found