Skip to content

fix: temporary fix for error where undefined is being passed to path.… #980

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

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

ege0zcan
Copy link
Contributor

@ege0zcan ege0zcan commented Apr 16, 2025

Problem

Trying to run the built artifacts gives the following error:

Uncaught Exception: The "path" argument must be of type string. Received undefined
node:internal/validators:162
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:405:5)
    at validateString (node:internal/validators:162:11)
    at dirname (node:path:1275:5)
...
  code: 'ERR_INVALID_ARG_TYPE'
}

This is happening due to changes introduced in: #949

This line in particular is the root cause: path.join(dirname(require.main!.filename), 'indexing')

require.main returns undefined so the ! assertion is a naive assertion here. And when path.join tries to join undefined with indexing it fails because path.join doesn't accept undefined

Solution

As a temporary fix, I have removed the problematic line and replaced it with a hardcoded value. I will let @breedloj know about this and discuss details

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ege0zcan ege0zcan requested a review from a team as a code owner April 16, 2025 17:30
@ege0zcan ege0zcan enabled auto-merge (squash) April 16, 2025 17:42
@ege0zcan ege0zcan merged commit 49e717c into main Apr 16, 2025
6 checks passed
@ege0zcan ege0zcan deleted the fixEmptyPath branch April 16, 2025 17:46
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 this pull request may close these issues.

2 participants