[node-resolve]: the external module render path is not expected

Open
#1,873 2 comments 0 reactions 1 assignee View on GitHub

@CharlieHelps is already working on this.

Since Oct 20, 2025.

Assessment

This issue has not been assessed yet.

Description

  • Rollup Plugin Name:
  • Rollup Plugin Version:
  • Rollup Version:
  • Operating System (or Browser):
  • Node Version:
  • Link to reproduction (⚠️ read below):
Expected Behavior

Expected render external module path with absolute path.

Actual Behavior

Get render external module path with original module request path.

Additional Information

reproduction
https://stackblitz.com/edit/github-ttay3lbj?file=package.json,rolldown.config.mjs,entry.js,rollup.config.js,rollup-without-node-resolve.config.js

Run npm run rollup::build:without-node-resolve, it using node js resolve instead of node-resolve plugin, here output

import { rollup } from 'file:///home/projects/vbwimvyraa.github/node_modules/.pnpm/rollup@4.41.1/node_modules/rollup/dist/es/rollup.js';

Run npm run build:rollup, it using node resolver plugin, here output

import { rollup } from 'rollup';

It caused by https://github.com/rollup/plugins/blob/master/packages/node-resolve/src/index.js#L329-L331. The rollup core is using 'file:///home/projects/vbwimvyraa.github/node_modules/.pnpm/rollup@4.41.1/node_modules/rollup/dist/es/rollup.js' to check external and find it is a external absolute module. But the node-resolve plugin overwrite it.

Dominant language
JavaScript
Stars
3.8k
Forks
635
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rollup/plugins

All issues in rollup/plugins

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.