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

v1.3.89 causes "ReferenceError: theme is not defined" in Antd design #8007

Closed
Kamahl19 opened this issue Sep 26, 2023 · 3 comments · Fixed by #8008
Closed

v1.3.89 causes "ReferenceError: theme is not defined" in Antd design #8007

Kamahl19 opened this issue Sep 26, 2023 · 3 comments · Fixed by #8008
Assignees
Labels
Milestone

Comments

@Kamahl19
Copy link

Describe the bug

I have upgraded vite-plugin-react-swc to latest which uses latest swc 1.3.89. When trying to import theme from Antd design https://github.com/Kamahl19/react-starter/blob/main/src/common/styleUtils.ts#L3 it throws ReferenceError: theme is not defined. When I use override to use v1.3.88, it works. Is the issue caused by SWC, vite plugin or is there a problem in Antd exports? Since this is the patch upgrade, shouldnt it be backward compatible? Thanks!

Input code

No response

Config

No response

Playground link

No response

SWC Info output

No response

Expected behavior

Should import same as in 1.3.88

Actual behavior

Throws ReferenceError: theme is not defined

Version

1.3.89

Additional context

No response

@kdy1
Copy link
Member

kdy1 commented Sep 26, 2023

@magic-akari Can you take a look?

@magic-akari
Copy link
Member

investigating:

export const createStyles = <
  T extends Record<string, SerializedStyles | ((theme: Theme) => SerializedStyles)>,
>(
  arg: T,
) => arg;

The theme is incorrectly removed due to this reference.

@kdy1 kdy1 self-assigned this Sep 26, 2023
@kdy1 kdy1 added this to the Planned milestone Sep 26, 2023
kdy1 pushed a commit that referenced this issue Sep 26, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.90 Sep 27, 2023
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 27, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

4 participants