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

[Bug Report] TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined #1317

Closed
pengzhen-developer opened this issue Nov 27, 2024 · 0 comments · Fixed by #1318

Comments

@pengzhen-developer
Copy link

Issue Type

  • Bug Report

Current/Missing Behaviour

TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received undefined
    at Object.resolve (node:path:198:9)
    at verify (file:///C:/nwjs-builder-phoenix/node_modules/nw-builder/src/get/verify.js:37:35)
    at async get (file:///C:/nwjs-builder-phoenix/node_modules/nw-builder/src/get/index.js:98:3)
    at async nwbuild (file:///C:/nwjs-builder-phoenix/node_modules/nw-builder/src/index.js:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v22.11.0

Expected/Proposed Behaviour

build success

Additional Info

- os: Windows 11
- node: v22.11.0
- npm: 10.9.0

build config

import nwbuild from 'nw-builder'


nwbuild({
  mode: "build",
  version: "0.14.7",
  flavor: 'normal',
  srcDir: './nw-app',
  outDir: './nw-builder/dist',
  cacheDir: './nw-builder/cache',
  glob: false,
  shaSum: false,
  logLevel: 'debug',
})

Possible related code.

// src/get/verify.js

const shasum = await fs.promises.readFile(shaOut, { encoding: 'utf-8' });
const shasums = shasum.trim().split('\n');
for await (const line of shasums) {
  // console.log(line)
  // => 204211732c21b8efdbb3a59bb72c2e52f8c8af1ab1cae0e0449fc720a3b38d5a nw-headers-v0.14.7.tar.gz
  // Why are two spaces needed here?
  const [storedSha, filePath] = line.split('  ');
  const relativeFilePath = path.resolve(cacheDir, filePath);
  ...
  ...
}
ayushmanchhabra pushed a commit that referenced this issue Nov 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.13.7](v4.13.6...v4.13.7)
(2024-11-28)


### Bug Fixes

* **get:** use \s+ to split lines containing shasum info
([64f5709](64f5709)),
closes [#1317](#1317)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant