Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing .js extension to export in "jsx-dev-runtime.js" #110

Merged

Conversation

volkanceylan
Copy link
Contributor

The following statement in jsx-dev-runtime.js fails with vitest:

export * from "./jsx-runtime";

Extensions in import statements are normally mandatory in esm and it fails in some environments like vitest with default configuration:

Error: Cannot find module 
'...\node_modules\.pnpm\[email protected]\node_modules\jsx-dom\jsx-runtime' 
imported from 
...\node_modules\.pnpm\[email protected]\node_modules\jsx-dom\jsx-dev-runtime.js

Also added a "min/jsx-dev-runtime.js" as it is causing vitest to fail resolving it when jsx-dom/min is used as automatic runtime:

Error: Failed to resolve import "jsx-dom/min/jsx-dev-runtime" from "src/base/dialogs.tsx". Does the file exist?
  Plugin: vite:import-analysis
  File: .../src/base/dialogs.tsx:431:49
  1  |  import { jsxDEV } from "jsx-dom/min/jsx-dev-runtime";

These two does not cause an issue with esbuild / swc / jest combination as I think they try .js extension and non-dev runtime unlike vitest does by default.

…ions are normally mandatory in esm and it fails in some environments like vitest with default configuration. Also add a "min/jsx-dev-runtime.js" as it is causing vitest to fail resolving it when jsx-dom/min is used as automatic runtime.
@alex-kinokon alex-kinokon merged commit 4855273 into alex-kinokon:master Dec 22, 2024
2 checks passed
@alex-kinokon
Copy link
Owner

Released as 8.1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants