Skip to content

'jsx' is not exported by node_modules/.pnpm/react@18.1.0/node_modules/react/jsx-runtime.js #5

@tajo

Description

@tajo

Describe the bug

Testing the main branch (including vitejs/vite#8546) since vite@3-alpha10 doesn't work for production builds of Ladle.

Log:

➜  example git:(test-vite) y ladle build            
yarn run v1.22.18
$ /Users/vojtech/Projects/ladle/packages/example/node_modules/.bin/ladle build
vite v3.0.0-alpha.10 building for production...
transforming (50) ../../../example/node_modules/.vite/deps_build/react-dom_client.js'jsx' is not exported by '../../node_modules/.pnpm/react@18.1.0/node_modules/react/jsx-runtime.js'
'jsxs' is not exported by '../../node_modules/.pnpm/react@18.1.0/node_modules/react/jsx-runtime.js'
'Fragment' is not exported by '../../node_modules/.pnpm/react@18.1.0/node_modules/react/jsx-runtime.js'
✓ 64 modules transformed.

If you try to run the server with build folder you get some generic error:

Uncaught ReferenceError: module is not defined
    at index.6fff39be.js:9:2024

(Is there a simple way how I could do this repro with StackBlitz?)

Reproduction

https://github.com/tajo/ladle/tree/test-vite

System Info

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Max
    Memory: 23.87 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.15.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
  Browsers:
    Chrome: 102.0.5005.61
    Firefox: 101.0
    Safari: 15.5

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions