Skip to content

Could not resolve 'eact/jsx-runtim' when using resolve aliases in JSX #5728

@avivkeller

Description

@avivkeller

Running node index.mjs with the following:

// index.mjs
import { build } from 'rolldown';

await build({
    input: 'entrypoint.jsx',
    resolve: {
        alias: {
            react: '', // This can be any value except "react"
        },
    },
});
// entrypoint.jsx
<></>

Produces:

file:///node_modules/rolldown/dist/shared/src-p50l1OMU.mjs:2270
        const wrapper = new Error(summary);
                        ^

Error: Build failed with 1 error:

[RESOLVE_ERROR] Error: Could not resolve 'eact/jsx-runtim' in entrypoint.jsx

    at normalizeErrors (file:///node_modules/rolldown/dist/shared/src-p50l1OMU.mjs:2270:18) 
    at handleOutputErrors (file:///node_modules/rolldown/dist/shared/src-p50l1OMU.mjs:3006:34)
    at transformToRollupOutput (file:///node_modules/rolldown/dist/shared/src-p50l1OMU.mjs:3000:2)
    at RolldownBuild.write (file:///node_modules/rolldown/dist/shared/src-p50l1OMU.mjs:4204:10)
    at async build (file:///node_modules/rolldown/dist/shared/src-p50l1OMU.mjs:4248:22)     
    at async file:///index.mjs:3:1 {
  errors: [Getter/Setter]
}

Node.js v22.14.0

Ref: nodejs/doc-kit#401

Metadata

Metadata

Assignees

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