Astro Info
Astro v5.15.1
Node v24.3.0
System macOS (arm64)
Package Manager bun
Output server
Adapter @astrojs/node
Integrations @astrojs/react
@astrojs/mdx
@astrojs/sitemap
@astrojs/partytown
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I was trying to use Astro's JSX in regular .tsx files but run into an issue in dev where it says:
Missing "./jsx-dev-runtime" specifier in "astro" package
This is because although jsx-runtime is exported, jsx-dev-runtime is not.
What's the expected result?
I expect JSX to work out of the box for dev and build modes.
There is a simple workaround though. If this is added to the Vite config, everything works as expected.
resolve: {
alias: {
'astro/jsx-dev-runtime': 'astro/jsx-runtime',
},
},
The issue can be solved quite easily by adding this to the exports section of package.json of astro package.
"./jsx-dev-runtime": {
"types": "./jsx-runtime.d.ts",
"default": "./dist/jsx-runtime/index.js"
},
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-azafjsrn?file=src%2Fcomponents%2FSimpleButton.tsx
StackBlitz doesn't work reliably for some reason. But you can clone to local and reproduce the issue.
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I was trying to use Astro's JSX in regular
.tsxfiles but run into an issue in dev where it says:This is because although
jsx-runtimeis exported,jsx-dev-runtimeis not.What's the expected result?
I expect JSX to work out of the box for dev and build modes.
There is a simple workaround though. If this is added to the Vite config, everything works as expected.
The issue can be solved quite easily by adding this to the
exportssection ofpackage.jsonofastropackage.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-azafjsrn?file=src%2Fcomponents%2FSimpleButton.tsx
StackBlitz doesn't work reliably for some reason. But you can clone to local and reproduce the issue.
Participation