-
Notifications
You must be signed in to change notification settings - Fork 85
Browser resolve fails in Node 6: opts.filename is undefined #38
Comments
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) ```
👍 This is a critical issue we are facing as well. In short, I believe that Node 6's internal In short, I think this can be handled multiple ways:
|
browserify/browser-resolve#80 was just merged, and is now available on npm as |
I confirm that issue is indeed resolved by updating said module. |
Sorry, just seeing this now – am I right in thinking this and #40 can be closed if the issue has been fixed upstream? thanks |
@Rich-Harris Yes, fixed upstream. |
Hello, I am still having the same problem after the update. Do I have to manually update the dependency of browser-resolve in the package.json of the module? └─┬ [email protected] I suppose it is correct, right? EDIT: |
@PixelVibe I've deleted |
@PixelVibe I'm also experiencing the same issue. Deleting |
This error is thrown only on Node 6, only when using
rollup-plugin-node-resolve
, and only when usingbrowser: true
. Those three conditions need to be met in order to reproduce this bug.The offending line of of code is in node-browser-resolve (
opts.filename
is undefined), so it's possible this bug doesn't exist here but rather in that repo. I wasn't sure, so I'm filing it here.I have a gist to reproduce.
Steps:
The error received is:
The text was updated successfully, but these errors were encountered: