Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

path.dirname(undefined) bug in v0.12.1 #233

Closed
MrBlenny opened this issue Nov 13, 2016 · 3 comments
Closed

path.dirname(undefined) bug in v0.12.1 #233

MrBlenny opened this issue Nov 13, 2016 · 3 comments

Comments

@MrBlenny
Copy link

MrBlenny commented Nov 13, 2016

In some versions of node/babel/webpack there are problems with path.dirname(undefined).

See here

path.dirname(undefined) will throw an error - as follows:

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:697:5)
    at Object.<anonymous> (C:\Users\david\repositories\stemn-electron\dist\main\index.js:11491:54)
    at __webpack_require__ (C:\Users\david\repositories\stemn-electron\dist\main\index.js:21:30)
    at Object.opt (C:\Users\david\repositories\stemn-electron\dist\main\index.js:11136:14)
    at __webpack_require__ (C:\Users\david\repositories\stemn-electron\dist\main\index.js:21:30)
    at Object.module.exports (C:\Users\david\repositories\stemn-electron\dist\main\index.js:10833:16)
    at __webpack_require__ (C:\Users\david\repositories\stemn-electron\dist\main\index.js:21:30)
    at Object.<anonymous> (C:\Users\david\repositories\stemn-electron\dist\main\index.js:10812:19)
    at __webpack_require__ (C:\Users\david\repositories\stemn-electron\dist\main\index.js:21:30)

Line 87 of lib/utils causes this problem for me in raven-node v0.12.1

var main_module = (require.main && path.dirname(require.main.filename) || process.cwd()) + '/';

This should be modified to become

var main_module = (require.main && require.main.filename && path.dirname(require.main.filename) || process.cwd()) + '/';
@LewisJEllis
Copy link
Contributor

Cool, this sounds like a potential ready-to-go pull request; @MrBlenny do you want to create a PR with the change? I can also just apply the change you've described here if you'd like.

@MrBlenny
Copy link
Author

I'm not actually sure how to create a PR for a specific release (as the code in master relates to the beta? not v0.12.1).

I created a copy of the repo @ v0.12.1 here that contains the change.

@LewisJEllis
Copy link
Contributor

@MrBlenny published this in v0.12.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants