question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v11 - Cannot read property 'key' of undefined

See original GitHub issue

Hey,

So, i have been playing around with the new v11 in an existing design system that used the v10 syntax which just seemed to work. However, in V11 emotion/react and styled is now implemented with nothing else changing. Previously, i never had to use the CacheProvider. However, i have upgraded from v10 to v11 (next) version and now when i try to get it to work in CRA (just importing my components from the package, say Button), for example, now results in this error…

TypeError: Cannot read property 'key' of undefined
createCache
node_modules/@emotion/cache/dist/cache.browser.esm.js:83
  80 | var movedStyles = false;
  81 | 
  82 | var createCache = function createCache(options) {
> 83 |   var key = options.key;
  84 |   var stylisOptions;
  85 | 
  86 |   if (!key) {
View compiled

I appreciate the is a newer version with little documentation, however i’m wandering what, a) i’m doing wrong b) is createCache now a default requirement or something… as i noticed that key is now required, and Nextjs _app.js now includes the< CacheProvider> component, where it was not required previously…

If this is not suited for here please close…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
MMT-LDcommented, Mar 29, 2020

FYI, rather then using “next” in package.json i added:

"@emotion/react": "^11.0.0-next.11",
"@emotion/styled": "^11.0.0-next.11"

this seemed to fix the above issue - in CRA

0reactions
Andaristcommented, Apr 18, 2020

Closing because it got stale and there are no followup actions we could take here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getting error as Cannot read property 'key' of undefined angular
It's because you are not passing any value to method setFillColor from your HTML code. You can pass current value as : (colorPickerChange)=" ......
Read more >
TypeError: Cannot read property 'get' of undefined - Discord
In enmap the path needs to be a string. Your passing a variable you haven't defined yet. Try: let prefix = client.settings.get(message.guild.id ...
Read more >
Changelog - Cypress Documentation
Cypress no longer throws the error "cannot read property split of undefined" in certain circumstances when application errors are thrown. Fixes #17378.
Read more >
“TypeError: Cannot read property 'key' of undefined” in vue
Error in nextTick: “TypeError: Cannot read property 'key' of undefined” in vue. I used same approach as https://streamable.com/zpk4m to make something ...
Read more >
Discord.js: TypeError: Cannot read properties of undefined ...
You are trying to access to a role property on an id which is not possible since it's not an object, the right...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found