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

Support RsBuild #37

Closed
longht021189 opened this issue May 10, 2024 · 7 comments · Fixed by #38
Closed

Support RsBuild #37

longht021189 opened this issue May 10, 2024 · 7 comments · Fixed by #38
Assignees
Labels
bug Something isn't working

Comments

@longht021189
Copy link

Hi, I post a discussion in facebook/stylex.

In discussion, I try to use unplugin-stylex with RsBuild but it's not working.

For a minimal reproduction repo, you can check here
https://github.com/longht021189/unplugin-stylex-sample/blob/main/rsbuild.config.ts

@eryue0220 eryue0220 self-assigned this May 10, 2024
@eryue0220 eryue0220 added the bug Something isn't working label May 10, 2024
@eryue0220
Copy link
Owner

Thanks for your feedback, I've found the bug. I'll fix it later today.

@eryue0220
Copy link
Owner

Hi @longht021189 Please upgrade the unplugin-stylex to 0.3.1 and now it workds. Or you can also refer to rsbuild-example. Finally, Thanks for your feedback.

@longht021189
Copy link
Author

Hi @eryue0220 Thank you for your help, it works. But it's still have a minor issue, this is my logs.

[@stylexjs/babel-plugin] Expected (options.unstable_moduleResolution) to be one of
        - `null` or `undefined`
        - one of
                - an object where:
                        - Expected "type": to be the literal "commonJS"
                        - Expected "rootDir": to be a string
                        - Expected "themeFileExtension": to be  -
                                - one of
                                        - `null` or `undefined`
                                        - a string
                        - {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}
                - an object where:
                        - Expected "type": to be the literal "haste"
                        - Expected "themeFileExtension": to be  -
                                - one of
                                        - `null` or `undefined`
                                        - a string
                        - {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}
                        - {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}
                - an object where:
                        - Expected "type": to be the literal "experimental_crossFileParsing"
                        - Expected "rootDir": to be a string
                        - Expected "themeFileExtension": to be  -
                                - one of
                                        - `null` or `undefined`
                                        - a string
                        - {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}
But got: {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}

And this is my configs
Screenshot 2024-05-12 205825

@eryue0220
Copy link
Owner

Hi @eryue0220 Thank you for your help, it works. But it's still have a minor issue, this is my logs.


[@stylexjs/babel-plugin] Expected (options.unstable_moduleResolution) to be one of

        - `null` or `undefined`

        - one of

                - an object where:

                        - Expected "type": to be the literal "commonJS"

                        - Expected "rootDir": to be a string

                        - Expected "themeFileExtension": to be  -

                                - one of

                                        - `null` or `undefined`

                                        - a string

                        - {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}

                - an object where:

                        - Expected "type": to be the literal "haste"

                        - Expected "themeFileExtension": to be  -

                                - one of

                                        - `null` or `undefined`

                                        - a string

                        - {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}

                        - {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}

                - an object where:

                        - Expected "type": to be the literal "experimental_crossFileParsing"

                        - Expected "rootDir": to be a string

                        - Expected "themeFileExtension": to be  -

                                - one of

                                        - `null` or `undefined`

                                        - a string

                        - {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}

But got: {"type":"commonjs","rootDir":"C:/Users/longh/OneDrive/Desktop/Projects/superapp/apps/utilities"}

And this is my configs

Screenshot 2024-05-12 205825

Sorry for the late response, I will check this later

@eryue0220
Copy link
Owner

@eryue0220 eryue0220 reopened this May 15, 2024
@eryue0220
Copy link
Owner

Hi @longht021189 I checked the bug, and I found the problem it's type should be set to commonJS, instead of commonjs;

@longht021189
Copy link
Author

Sorry, I have a little busy. It's ok.
I used pnpm patch to work around this typo issue.
Thank you so much.

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