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

[@rollup/plugin-node-resolve] Cannot read property 'custom' of undefined #1023

Closed
dstaley opened this issue Oct 19, 2021 · 5 comments
Closed

Comments

@dstaley
Copy link

dstaley commented Oct 19, 2021

Expected Behavior

Bundle is created (or at least an error about TypeScript).

Actual Behavior

./test/index_test.ts → dist/test-suite.js...
[!] (plugin node-resolve) TypeError: Cannot read property 'custom' of undefined
TypeError: Cannot read property 'custom' of undefined
    at Object.resolveId (/home/runner/rollup-plugin-repro-1/node_modules/@rollup/plugin-node-resolve/dist/cjs/index.js:1162:83)
    at /home/runner/rollup-plugin-repro-1/node_modules/rollup/dist/rollup.js:12899:25

Additional Information

I ran into this issue while trying to reproduce an issue with the TypeScript plugin.

@tjenkinson
Copy link
Member

@dstaley I think you're rollup version in the description is incorrect? In the repl you have ^1.27.14. 2.58.0 works fine

@shellscape
Copy link
Collaborator

@rollup/plugin-node-resolve has a peer dep of ^2 as well, so this wouldn't actually be a bug, but a violation of peerDep requirements, which we're not responsible for supporting. see:

"rollup": "^2.42.0"

@tjenkinson
Copy link
Member

Agree. The rollup peer dependency requirement of the resolve plugin is ^2.42.0, which works fine given custom was added in 2.29.0, so closing this.

@dstaley
Copy link
Author

dstaley commented Oct 31, 2021

Sorry about that! The Replit UI confusingly lists the latest version of installed packages in their UI versus the actually installed version.

image

@0xdevalias
Copy link

0xdevalias commented Jul 13, 2022

Should the README be updated to align with this then? As currently it says:

This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.

Yet package.json suggests that it actually requires Node >= 10.0.0 and peerDependencies of "rollup": "^2.42.0"

Looking at the CHANGELOG, i'm not sure this was marked as a breaking change anywhere either was it?


Edit: I've opened an issue to track this specficially:

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

Successfully merging a pull request may close this issue.

4 participants