Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Browser resolve fails in Node 6: opts.filename is undefined #38

Closed
@nolanlawson

Description

@nolanlawson

This error is thrown only on Node 6, only when using rollup-plugin-node-resolve, and only when using browser: 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:

git clone https://gist.github.com/e029b935459d4cdb5097d1a74485be63.git gist && cd gist
npm i && node build.js

The error received is:

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at resolve (/Users/nolan/Desktop/repro-rollup-bug/node_modules/browser-resolve/index.js:218:21)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions