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

Fix Node v6 #80

Merged
merged 2 commits into from
May 25, 2016
Merged

Fix Node v6 #80

merged 2 commits into from
May 25, 2016

Conversation

msokk
Copy link
Contributor

@msokk msokk commented May 3, 2016

Latest Node is more strict with path.dirname, throwing on passing undefined - nodejs/node#5348

Also added newer Node versions to Travis test matrix.

@zhanzhenzhen
Copy link

Do you mean the problem is in this package, not the resolve package?

I have opened an issue here but got no response:
browserify/resolve#98

@defunctzombie
Copy link
Collaborator

If this doesn't get fixed upstream in resolve ping me in a few days and I'll release this patch.

@zhanzhenzhen
Copy link

@defunctzombie Sorry I just have time to test resolve. It works! So I think the problem is only in this package.

@@ -2,3 +2,6 @@ language: node_js
node_js:
- "0.8"
- "0.10"
- "4"
- "5"
- "6"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just be "node" so it's always latest stable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends how many Node versions we want to test against? 4 is still LTS.

@mattbailey
Copy link

@defunctzombie doesn't look like this has been resolved upstream yet; could you get this patched in?

Thanks!

@zhanzhenzhen
Copy link

@defunctzombie It seems the bug is only in browser-resolve, not in the upstream resolve package through my test. So you don't have to wait.

@msokk
Copy link
Contributor Author

msokk commented May 17, 2016

Yes, the exception happens in this package, it has nothing to do with upstream.

Currently the https://github.com/rollup/rollup-plugin-node-resolve downstream package is broken due to this on Node v6.

@zhanzhenzhen
Copy link

why this is still unmerged? Tested Node 6.2 but the problem still exists.

@nkoterba
Copy link

👍 Please check this patch in. I just submitted another pull request (#81) to essentially fix the same problem. As @msokk mentioned, this is breaking https://github.com/rollup/rollup-plugin-node-resolve and our build system.

Thanks.

nkoterba added a commit to nkoterba/rollup-plugin-node-resolve that referenced this pull request May 25, 2016
Please see:

rollup#38
and
browserify/browser-resolve#80

for how Node v6+ throws a TypeError if `path.dirname` is passed an undefined value.  `node-browser-resolve` currently does not use set a default value if it's `opts.filename` is not specified resulting in the following stack trace:
```javascript
[19:40:45] TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at resolve (/my_app/node_modules/browser-resolve/index.js:218:21)
    at /my_app/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js:46:5
    at resolveId (/my_app/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js:45:11)
    at /my_app/node_modules/rollup/dist/rollup.js:2123:32
    at tryCatch (/my_app/node_modules/rollup/dist/rollup.js:393:12)
    at invokeCallback (/my_app/node_modules/rollup/dist/rollup.js:405:13)
    at publish (/my_app/node_modules/rollup/dist/rollup.js:376:7)
    at flush (/my_app/node_modules/rollup/dist/rollup.js:120:5)
```
@defunctzombie defunctzombie merged commit 8e6eca2 into browserify:master May 25, 2016
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.

6 participants