Skip to content

Conversation

akre54
Copy link

@akre54 akre54 commented Nov 25, 2022

Attempting to require paper outside of a file context (i.e the node command line repl) leads to an error loading the path because parent.filename is undefined.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
    at __node_internal_captureLargerStackTrace (node:internal/errors:477:5)
    at new NodeError (node:internal/errors:387:5)
    at validateString (node:internal/validators:115:11)
    at Object.dirname (node:path:1276:5)
    at Object.<anonymous> (/.../node_modules/paper/dist/node/self.js:22:48)

This adds a short-circuit check which seems to fix the issue.

Attempting to require paper outside of a file context (i.e the node command line repl) leads to an error loading the path because `parent.filename` is undefined.

```
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
    at __node_internal_captureLargerStackTrace (node:internal/errors:477:5)
    at new NodeError (node:internal/errors:387:5)
    at validateString (node:internal/validators:115:11)
    at Object.dirname (node:path:1276:5)
    at Object.<anonymous> (/.../node_modules/paper/dist/node/self.js:22:48)
```

This adds a short-circuit check which seems to fix the issue.
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.

1 participant