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

Using TypeScript module import in makeStyles call causes Vite build error #627

Open
tobz1000 opened this issue Dec 13, 2024 · 0 comments
Open

Comments

@tobz1000
Copy link

tobz1000 commented Dec 13, 2024

If I import value from a TS module, which includes non-JS syntax (typedefs etc.), and use it within makeStyles, the vite build command will fail with an error like:

error during build:
[wyw-in-js] /src/mod.ts: Missing initializer in const declaration. (3:17)

  1 | export const HEIGHT0 = "100px";
  2 |
> 3 | const _some_value: number = 0;
    |                  ^
  4 |

It looks like the plugin attempts to parse the imported module as plain JS.

Using values from the same module as the makeStyles call will not cause a failure, nor will importing a value from a module which is plain JS syntax.

Demo repo: https://github.com/tobz1000/griffel-627-repro

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

1 participant