-
Notifications
You must be signed in to change notification settings - Fork 33
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
ttsc and webpack not matching className #63
Comments
Hey @SomethingSexy can you show how is Nevertheless, it seems |
Also, it'd be useful to know what the versions of the transformer as well as the versions of typescript are used to compile code for server and for client. If they are different it might produce discrepancies in generating ids of components. Second, make sure the And lastly, the difference may come from the styled-components itself. This tranformer only generates constant css classnames of components. They also have another classname that is dynamic and based on what styles are actually being applied. |
Thanks for the feedback! I will look into your suggestions this week. If those don't work I will provide relevant code. |
OK so made sure things matched up and I am still seeing differences. Here are the versions I am using:
Here is what my webpack transformer looks like. I keep the ssr true in there for now.
It doesn't look like any of the classes are matching up:
Also just to make sure I am not missing something, this is how I am running the TS build in my npm scripts:
|
Hm, is it possible that the root compilation folder in Please take a look if that is something you can configure on your site. I'll also investigate that case. |
That is a good thought! I will investigate that further. |
So I think your thought is correct but I am not sure why it is doing that. So when I run the build with ttsc the sourceRoot is undefined. When it runs through webpack though it has a sourceRoot set. |
Try to set |
Doh! Ya I think that is it. Makes sense. Testing it now. |
Yup that did it! Thank you for working through this with me. |
Good to hear it! I'm closing this, but with added an action item #73 |
Do I need to use the same transformer reference if I am using ttsc to build the server-side and webpack to use the client side?
This is my tsconfig that is being run using ttsc.
My webpack configuration is using:
However, I am still getting Prop className did not match with a different class name on the server vs the client. Am I missing something?
The text was updated successfully, but these errors were encountered: