Error while running watch script

I’ve followed the development guide and yarn start returns me this error

[nodemon] restarting due to changes...
[nodemon] starting `node _build/stubs/app/server/server.js`
node:internal/modules/cjs/loader:1146
  throw err;
  ^

Error: Cannot find module 'app/common/gristUrls'
Require stack:
- C:\projects\tmp\grist-core\_build\stubs\app\server\server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (C:\projects\tmp\grist-core\_build\stubs\app\server\server.js:32:21)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\projects\\tmp\\grist-core\\_build\\stubs\\app\\server\\server.js'
  ]
}

Any ideas? Running this on windows with node v20.

Did yarn run build:prod succeed?

Yes it ran succesfully, I also see the built js files it’s trying to require :slight_smile:

For some reason the import path doesn’t seem to register

Hmm, just double-checked on a clean build and things work for me on Linux. I guess I’d suspect some path difference on Windows then.

The key line I’d suspect is this:

The NODE_PATH there is trying to tell node to check for files in any of _build, _build/stubs, or _build/ext in the current directory. Perhaps you could experiment with putting the exact directories there to see if there’s some problem with slashes or relative vs absolute or who knows what?

Yes! running NODE_PATH="_build;_build/stubs" && node _build/stubs/app/server/server.js works :slight_smile: Thank you!