Skip to content

(!) Plugin commonjs--resolver: It appears a plugin has implemented a "resolveId" hook that uses "this.resolve" without forwarding the third "options" parameter of "resolveId" #207

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

Closed
josdejong opened this issue Mar 1, 2023 · 2 comments · Fixed by #208

Comments

@josdejong
Copy link

After upgrading from 7.1.2 to 7.1.3 I get the following warning when using rollup:

(!) Plugin commonjs--resolver: It appears a plugin has implemented a "resolveId" hook that uses "this.resolve" without forwarding the third "options" parameter of "resolveId". This is problematic as it can lead to wrong module resolutions especially for the node-resolve plugin and in certain cases cause early exit errors for the commonjs plugin.
In rare cases, this warning can appear if the same file is both imported and required from the same mixed ES/CommonJS module, in which case it can be ignored.

I'm not sure if this is caused by rollup-plugin-svelte itself or a side effect from an other plugin. Any idea how to pinpoint this? Can it be casused by this commit 3be2d58?

@dummdidumm
Copy link
Member

dummdidumm commented Mar 1, 2023

Yeah it's probably from that commit - I'm not sure how to work around this / how to silence the warning because it's essentially a false positive

@josdejong
Copy link
Author

josdejong commented Mar 1, 2023

Probably,

async resolveId(importee, importer) {
  // ...
  const resolved = await this.resolve(importee, importer, { skipSelf: true });
  //...
}

Should be changed to something like:

async resolveId(importee, importer, options) {
  // ...
  const resolved = await this.resolve(importee, importer, { skipSelf: true, ...options });
  //...
}

EDIT: for reference, see lightyen/typescript-paths#3

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 a pull request may close this issue.

2 participants