Skip to content

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

@damienflament

Description

@damienflament

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.

Activity

Tao-VanJS

Tao-VanJS commented on May 19, 2024

@Tao-VanJS
Member

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

added a commit that references this issue on May 19, 2024
fde00fb
cqh963852

cqh963852 commented on May 24, 2024

@cqh963852
Contributor

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

cqh963852 commented on May 24, 2024

@cqh963852
Contributor

I checked the history, this should be a modification error

image

thednp

thednp commented on Dec 24, 2024

@thednp
Contributor

@damienflament @cqh963852 please check out the:

Powered by vite-plugin-vanjs.

cqh963852

cqh963852 commented on Feb 1, 2025

@cqh963852
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @damienflament@thednp@cqh963852@Tao-VanJS

      Issue actions

        [vanjs-jsx] Add missing ./src/jsx-runtime.js · Issue #325 · vanjs-org/van