Skip to content

[Bug]: @rollup/plugin-node-resolve incorrectly parses module paths during bundling #1890

Closed

Description

@Hoshino-Yumetsuki

@rollup/plugin-node-resolve incorrectly parses module paths during bundling, resulting in malformed import paths in the output JavaScript file.

It will generate the import with the path of the node_modules like

import { h as e } from "E:ProjectsRMPR\node_moduleskoishilibindex.mjs";
e(``);
var t = e;
export { t as default };

minimal reproduce

import { h } from 'koishi'
h('')
export default h
}

main().catch(error => console.error('Error in main function:', error))
import resolve from '@rollup/plugin-node-resolve'

export default {
  input: 'src/main.ts',
  output: {
    file: 'dist/main.js',
    minify: true
  },
  external: [/node_modules/],
  platform: 'node',
  plugins: [resolve()]
}

Activity

  1. locked and limited conversation to collaborators on Aug 6, 2025
  2. converted this issue into a discussion #1891 on Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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