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]: rslib run storybook can't parse *.less file and *jsx file #530

Closed
shimingw opened this issue Dec 6, 2024 · 6 comments
Closed

[Bug]: rslib run storybook can't parse *.less file and *jsx file #530

shimingw opened this issue Dec 6, 2024 · 6 comments

Comments

@shimingw
Copy link

shimingw commented Dec 6, 2024

Version

System:
    OS: macOS 14.6
    CPU: (8) arm64 Apple M3
    Memory: 258.08 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 131.0.6778.109
    Safari: 17.6
  npmPackages:
    @rslib/core: ^0.1.2 => 0.1.2

Details

first problem

when i run pnpm dev or pnpm build, i can run correctly. even i create a new project by rslib , i alose get this error
but when i run pnpm storybook or pnpm build:storybook, i get a less-loader error, like this
Image

second problem

if i use .jsx extension file, i will got a error, like this, even i create a new project by rslib and use javascript , i alose get this error
Image

Reproduce link

none

Reproduce Steps

first problem

  1. create a new project, use .less extension file, and add @rsbuild/plugin-less
  2. execute pnpm storybook
  3. you will get the error

second proble

  1. create a new prkect and use javascript and jsx
  2. execute pnpm storybook
  3. you will get the error
@shimingw shimingw added the 🐞 bug Something isn't working label Dec 6, 2024
@shimingw shimingw changed the title [Bug]: rslib run storybook can't parse *.less file [Bug]: rslib run storybook can't parse *.less file and *tsx file Dec 6, 2024
@shimingw shimingw changed the title [Bug]: rslib run storybook can't parse *.less file and *tsx file [Bug]: rslib run storybook can't parse *.less file and *jsx file Dec 6, 2024
@fi3ework
Copy link
Member

fi3ework commented Dec 7, 2024

Please provide a minimal reproduction to help us address the issue, we cannot assist with troubleshooting based on the information currently provided.
Thanks.

Why reproduction is required

@fi3ework fi3ework added need reproduction A minimal reproduction is needed to troubleshoot the issue. and removed 🐞 bug Something isn't working labels Dec 7, 2024
@shimingw
Copy link
Author

Please provide a minimal reproduction to help us address the issue, we cannot assist with troubleshooting based on the information currently provided. Thanks.

Why reproduction is required

https://github.com/shimingw/rslib-bug-report/tree/main/rslib-project-demo

this demo can recurrent the problem, when you run command pnpm storybook. you will see.

@fi3ework
Copy link
Member

  1. Follow the document, configure the project correctly. You can check the example https://github.com/rspack-contrib/storybook-rsbuild/blob/main/sandboxes/rslib-react-component/.storybook/main.ts here.
  2. Add react-dom to 18.3.1 to the dev dependencies.

@fi3ework fi3ework removed the need reproduction A minimal reproduction is needed to troubleshoot the issue. label Dec 10, 2024
@shimingw
Copy link
Author

sorry, i forgot push my .storybook folder, now, i had update my storybook/main.ts file. and update my dependency base on your example :https://github.com/rspack-contrib/storybook-rsbuild/blob/main/sandboxes/rslib-react-component/package.json.
but, wo got a new error. i had update my reproduction:https://github.com/shimingw/rslib-bug-report/tree/main/rslib-project-demo
Image

@Timeless0911
Copy link
Collaborator

You should update these packages
Image

@shimingw
Copy link
Author

You should update these packages Image

thank you, it's worked.

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

No branches or pull requests

3 participants