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

[Bug]: failed to compile dist jsx code #2727

Closed
wxiaoyun opened this issue Jun 29, 2024 · 5 comments · Fixed by #2729
Closed

[Bug]: failed to compile dist jsx code #2727

wxiaoyun opened this issue Jun 29, 2024 · 5 comments · Fixed by #2729
Labels
🐞 bug Something isn't working

Comments

@wxiaoyun
Copy link

wxiaoyun commented Jun 29, 2024

Version

System:
    OS: Linux 6.9 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
    Memory: 24.42 GB / 31.25 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  npmPackages:
    @rsbuild/core: ^0.7.10 => 0.7.10
    @rsbuild/plugin-babel: ^0.7.10 => 0.7.10
    @rsbuild/plugin-solid: ^0.7.10 => 0.7.10

Details

Description

  • Rsbuild faces compilation error when importing icons from solid icons
  • Not sure if its a rsbuild problem or solid icons package problem. The problem goes away if I change the dist code to import from index.js instead of index.jsx
  Rsbuild v0.7.10

  > Local:    http://localhost:3000/
  > Network:  http://192.168.10.145:3000/

start   Compiling...
error   Compile error:
Failed to compile, check the errors for troubleshooting.
File: /home/wuxiaoyun/dev/solidjs-rsbuild/node_modules/.pnpm/[email protected][email protected]/node_modules/solid-icons/lib/index.jsx:1:1
  × Module build failed:
  ├─▶   ×
  │     │   × Expected '>', got 'stroke'
  │     │     ╭─[/home/wuxiaoyun/dev/solidjs-rsbuild/node_modules/.pnpm/[email protected][email protected]/node_modules/solid-icons/lib/index.jsx:10:1]
  │     │  10 │     onCleanup(() => {
  │     │  11 │         setContent("");
  │     │  12 │     });
  │     │  13 │     return (<svg stroke={iconSrc.a?.stroke} color={props.color || "currentColor"} fill={props.color || "currentColor"} stroke-width="0" style={{
  │     │     ·                  ──────
  │     │  14 │             ...props.style,
  │     │  15 │             overflow: "visible",
  │     │  16 │         }} {...svgProps} height={props.size || "1em"} width={props.size || "1em"} xmlns="http://www.w3.org/2000/svg" innerHTML={content()}>
  │     │     ╰────
  │     │
  │
  ╰─▶ Syntax Error

Reproduce link

https://github.com/wxiaoyun/rsbuild-solidjs-icon-bug-reproduction.git

Reproduce Steps

git clone https://github.com/wxiaoyun/rsbuild-solidjs-icon-bug-reproduction.git
cd rsbuild-solidjs-icon-bug-reproduction
pnpm i
pnpm dev
@wxiaoyun wxiaoyun added the 🐞 bug Something isn't working label Jun 29, 2024
@chenjiahan
Copy link
Member

You can remove the exclude option here:

image

@wxiaoyun
Copy link
Author

You can remove the exclude option here:

image

Thanks a lot!

@wxiaoyun
Copy link
Author

@chenjiahan It is hard to debug with just the compile error, without the stack trace. I didnt find any options in the Rsbuild CLI such as --verbose. Did I missing anything

@chenjiahan
Copy link
Member

Try this:

@wxiaoyun
Copy link
Author

Try this:

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants