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

0.4.1: stylex.inject is not a function #334

Closed
olivierpascal opened this issue Jan 11, 2024 · 8 comments
Closed

0.4.1: stylex.inject is not a function #334

olivierpascal opened this issue Jan 11, 2024 · 8 comments

Comments

@olivierpascal
Copy link

olivierpascal commented Jan 11, 2024

The problem

0.3.0: working fine
0.4.1: stylex.inject is not a function

Either with vite or webpack.

I'm not really sure which information you may need to dig into this.

@pawelblaszczyk5
Copy link

I guess it’s related to this one and you need to import the inject method from different entry point - #163

@olivierpascal
Copy link
Author

I guess it’s related to this one and you need to import the inject method from different entry point - #163

I am not even using inject in my code.

@olivierpascal
Copy link
Author

Ok, probably related to HorusGoul/vite-plugin-stylex#29

@olivierpascal
Copy link
Author

In the meantime, this workaround is working: HorusGoul/vite-plugin-stylex#29 (comment)

Closing.

@nmn
Copy link
Contributor

nmn commented Jan 11, 2024

Please try using 0.5.0-alpha.2. The problem should be fixed as it adds an ESM export for stylex-inject.

@bigfootjon
Copy link
Member

@nmn I just tried updating to 0.5.1 and I'm having this problem with webpack :/

Uncaught TypeError: stylex.inject is not a function
...

Looking through the stack trace it looks like babel is adding calls to stylex.inject which are then broken in webpack. Let me know if I can provide any other debugging info to help

@nmn
Copy link
Contributor

nmn commented Jan 27, 2024

@bigfootjon Can you clear all caches. Re-install node_modules and try again? stylex.inject hasn't been injected since 0.4.1, so that code appearing at all seems like a caching issue.

@bigfootjon
Copy link
Member

Yep that was it! My node_modules somehow still had 0.4.1 installed

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

4 participants