Reproduction link or steps
Rolldown seems to currently ignore the jsxImportSource declaration in tsconfig.json. I haven't checked whether the jsx, jsxFactory, and jsxFragmentFactory compiler options are currently being honoured, but it's possible that they also aren't.
Repository with a minimal reproduction using preact: https://github.com/YarnSphere/rolldown-jsx-import-source
- Install dependencies and run the build script.
What is expected?
The provided code should compile with no warnings and correctly reference preact's JSX function.
Notably, explicitly adding a TypeScript pragma to files containing JSX (/** @jsxImportSource preact */) does work around the issue, as described in oxc-project/oxc#3560.
Here's the expected build output for the referenced project (and current build output when explicitly adding the pragma):
> rolldown -c
<DIR>/app.js chunk │ size: 16.71 kB
✔ Finished in 15.69 ms
The bundled JavaScript correctly bundles and references preact's JSX function.
What is actually happening?
Here's the current build output:
> rolldown -c
[UNRESOLVED_IMPORT] Warning: Could not resolve 'react/jsx-runtime' in src/index.tsx
<DIR>/app.js chunk │ size: 15.97 kB
✔ Finished in 18.32 ms
The bundled JavaScript then starts with an incorrect:
import { jsx } from "react/jsx-runtime";
System Info
System:
OS: Linux 6.12 Fedora Linux 41 (Workstation Edition)
CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics
Memory: 40.13 GB / 62.21 GB
Container: Yes
Shell: 3.7.0 - /usr/bin/fish
Binaries:
Node: 22.11.0 - /usr/bin/node
npm: 10.9.0 - /usr/bin/npm
pnpm: 9.13.0 - /usr/bin/pnpm
npmPackages:
rolldown: latest => 1.0.0-beta.3
Reproduction link or steps
Rolldown seems to currently ignore the
jsxImportSourcedeclaration intsconfig.json. I haven't checked whether thejsx,jsxFactory, andjsxFragmentFactorycompiler options are currently being honoured, but it's possible that they also aren't.Repository with a minimal reproduction using preact: https://github.com/YarnSphere/rolldown-jsx-import-source
What is expected?
The provided code should compile with no warnings and correctly reference preact's JSX function.
Notably, explicitly adding a TypeScript pragma to files containing JSX (
/** @jsxImportSource preact */) does work around the issue, as described in oxc-project/oxc#3560.Here's the expected build output for the referenced project (and current build output when explicitly adding the pragma):
The bundled JavaScript correctly bundles and references preact's JSX function.
What is actually happening?
Here's the current build output:
The bundled JavaScript then starts with an incorrect:
System Info
System: OS: Linux 6.12 Fedora Linux 41 (Workstation Edition) CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics Memory: 40.13 GB / 62.21 GB Container: Yes Shell: 3.7.0 - /usr/bin/fish Binaries: Node: 22.11.0 - /usr/bin/node npm: 10.9.0 - /usr/bin/npm pnpm: 9.13.0 - /usr/bin/pnpm npmPackages: rolldown: latest => 1.0.0-beta.3