-
Hey team 👋 I am trying to clean up our role, removing some unused dependencies and upgrading others, and when I am running our tests i'm facing a weird errors, like: TypeError: Cannot read property 'space40' of undefined
153 | BetaFeatureEnabledMock.mockReturnValue(true);
154 | server.use(...handlers);
> 155 | render(
| ^
156 | <NotificationStoreProvider>
157 | <ToasterStoreProvider>
158 | <SettingsContext.Provider value={RECORDINGS_SETTINGS_CONTEXT}> I thought it was related to the design tokens (since I removed them as dependency, AFAIK it should come from @paste-core) but then I tried to install the latest version and I having the same issue... I have checked both providers and none of them are using design tokens :/ Another error is that now there is a bunch of console.error, like: console.error
Paste: "colorBorderLight" is a deprecated design token. It will be removed in the 2021.11.16 release of Paste But we are not using any of there design tokens, at least, hardcoded. Finally, the weird one is that a input that is expecting a string now it complains that is receiving a number. It's weird because it was working before the upgrade and typescript doesn't complain about type checking (numer !== string) FAIL client/src/settings/rooms/components/__tests__/Settings.test.tsx (13.028 s)
● Settings › should allow us to change the room type and save it
Warning: Failed prop type: Invalid prop `value` of type `number` supplied to `Input`, expected `string`.
in Input (created by RoomTopology)
in RoomTopology (created by Settings)
in div (created by Context.Consumer)
in Styled(div) (created by Box)
in Box (created by Settings)
in Settings (created by SettingsWithToaster)
in ToasterStoreProvider (created by SettingsWithToaster)
in div (created by Context.Consumer)
in Styled(div) (created by L)
in At (created by L)
in L (created by SettingsWithToaster)
in SettingsWithToaster Here it's my pull request, I will try to figure out meanwhile but if you could have any clue or idea I would appreciate it! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @tomtobac, I'm checking with the rest of the team and will get back to you. Hang tight! Let us know here if you make any progress on your end. |
Beta Was this translation helpful? Give feedback.
-
Hi @tomtobac
I can't tell where this code is in your project, but can you make sure it is being wrapped by the Theme.Provider? This error is saying that
This shouldn't be breaking builds, but is worth upgrading anyways. Since introducing the dark theme, the token names ending with
I'm not sure what caused this to silently fail in the past, but it reads like a valid error. I'd recommend following the stacktrace to see if you're setting |
Beta Was this translation helpful? Give feedback.
Hi @tomtobac
I can't tell where this code is in your project, but can you make sure it is being wrapped by the Theme.Provider? This error is saying that
theme
is undefined, sotheme.space40
doesn't exist. My first hunch is that the Theme.Provider isn't wrapping this code. Is it in a portal for example?This shouldn't be breaking builds, but is worth upgrading anyways. Since introducing the dark theme, the token names ending with
light
anddark
no longer made sense. We swapped them toweak
andstrong
, respectively. You can …