cc-tweaked / CC-Tweaked

Just another ComputerCraft fork
https://tweaked.cc
882 stars 206 forks source link

[1.20.x] Build task fail with typescript error #1805

Closed tmvkrpxl0 closed 2 months ago

tmvkrpxl0 commented 2 months ago

I've been following build instruction but it fails with typescript error:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
    at new NodeError (node:internal/errors:399:5)
    at validateString (node:internal/validators:163:11)
    at Object.join (node:path:1172:7)
    at <anonymous> (/tmp/CC-Tweaked/projects/web/src/htmlTransform/index.tsx:62:33) {
  code: 'ERR_INVALID_ARG_TYPE'
}

File CC-Tweaked/projects/web/src/htmlTransform/index.tsx references file.path which does not exist on my pc: https://github.com/cc-tweaked/CC-Tweaked/blob/550296edc5ab58373aebc0040dea95980be5d2d2/projects/web/src/htmlTransform/index.tsx#L59

To confirm this I have ran this command on node(v18.14.0)

await fs.readdir("/tmp/CC-Tweaked/projects/web/build/illuaminate", { withFileTypes: true, recursive: true }, function(err, file) { console.log(file.path + "") })

This prints "undefined". running it with file instead of file.path prints these entries instead:

Dirent { name: 'basic-terminal-45a33440.png', [Symbol(type)]: 1 
tmvkrpxl0 commented 2 months ago

I've upgraded node to v20.12.2 and did the same test. The result was same.