-
Notifications
You must be signed in to change notification settings - Fork 74
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
[3.1.3] typing issue with @emotion/serialize #189
Comments
Same issue here. |
Hi, same issue here. This looks like a breaking change rather than a minor update. We've had to manually force the csstype in our |
Same issue, using the library react-select @JedWatson/ |
Same issue when using material-ui with emotion |
I came across something similar a while back, and I can't remember where I found the original solution, but you can use "resolutions" (for yarn) or "overrides" (for npm) in your package.json to handle issues like this. probably a good idea to review them fairly often, but much better than modifying package-lock.json or yarn.lock in package.json add this:
or if using npm instead of yarn:
|
I did a little digging into the types in question, and here's the simplified reproduction code (minimized from emotion's code base): import * as CSS from 'csstype';
type CssValue = number | string;
interface CSSOthersObject {
[propertiesName: string]: CssValue | CssValue[]
}
interface CSSObject extends CSS.PropertiesFallback<CssValue>, CSSOthersObject {
} If we use const stylesMapper: (base: CSSObject) => CSSObject = base => ({...base, zIndex: 2}); ...which generated more helpful error:
Then, a single change has fixed all the errors present: interface CSSOthersObject {
[propertiesName: string]: CssValue | (readonly CssValue[])
} I agree that breakage in patch release is really unexpected, but probably it's not that big deal. For |
Confirmed @abvolatile your solution worked for me with overrides in package.json. Will prob just use that for now until this gets sorted out |
Hey 👋 is there any chance that we can get this change rolled forward and undone? Granted it's a small breaking change, but still breaking either way and looks like it's broken a lot of libraries? We don't have the ability to use |
Not sure if this should be a
@emotion
issue, but a patch should probably not break a build like this, so I'm posting the issue here for now 😅Bumping this to 3.1.3 results in a lot of type errors related to
@emotion/serialize
:For reference, here's the
@emotion/serialize
file (node_modules/@emotion/serialize/types/index.d.ts
):The text was updated successfully, but these errors were encountered: