Skip to content
New issue

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

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

Already on GitHub? # to your account

[vanjs-jsx] Add missing ./src/jsx-runtime.js #325

Open
damienflament opened this issue May 19, 2024 · 5 comments · May be fixed by #329
Open

[vanjs-jsx] Add missing ./src/jsx-runtime.js #325

damienflament opened this issue May 19, 2024 · 5 comments · May be fixed by #329

Comments

@damienflament
Copy link

damienflament commented May 19, 2024

Hi !

I'm configuring Vite to transform JSX using vanjs-jsx.

It's a JavaScript project so I don't do configuration in the tsconfig.json file but in vite.config.js :

import { defineConfig } from 'vite'

export default defineConfig({
  ...
  esbuild: {
    jsx: 'automatic',
    jsxImportSource: 'vanjs-jsx'
  }
})

It's working fine using the development server. But when building, vanjs-jsx/jsx-runtime is not found.

Patching the package using Yarn by adding the missing file fix the issue.

Thanks.

@Tao-VanJS
Copy link
Member

@cqh963852, could you take a look at this issue?

damienflament added a commit to damienflament/van that referenced this issue May 19, 2024
This was referenced May 19, 2024
@cqh963852
Copy link
Contributor

cqh963852 commented May 24, 2024

The path to jsx-runtime.js is defined in package.json.

Could it be that esbuild is using an old specification for path lookup?

Maybe this line should be adjusted

"require": "./src/jsx-runtime.js",

  "require": "./src/index.js",
  "import": "./src/index.js",
  "types": "./src/jsx-runtime.d.ts"

@cqh963852
Copy link
Contributor

I checked the history, this should be a modification error

image

@thednp
Copy link
Contributor

thednp commented Dec 24, 2024

@damienflament @cqh963852 please check out the:

Powered by vite-plugin-vanjs.

@cqh963852
Copy link
Contributor

@thednp Hi, I have check the plugin vite-plugin-vanjs, I think this plugin brings a better practice than vanjs-jsx.

@Tao-VanJS Please mark vanjs-jsx as deprecated.

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

Successfully merging a pull request may close this issue.

4 participants