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.

TypeError: vendor.supportedKeyframes is not a function

See original GitHub issue
  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

import { install } from '@material-ui/styles';
install();

should switch default style implementation and don’t throw an error.

Current Behavior 😯

It throws this error when install() is called before and an component is mounted. When I remove this line, I don’t get any error, but it uses the old style implements (of course).

Storybook build:

vendor.supportedKeyframes is not a function
    TypeError: vendor.supportedKeyframes is not a function
    at Array.onProcessRule (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:68668:26)
    at PluginsRegistry.onProcessRule (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:69245:36)
    at Array.forEach (<anonymous>)
    at RuleList.process (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:69499:27)
    at new StyleSheet (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:69856:16)
    at Jss.createStyleSheet (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:69090:19)
    at attach (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:40795:39)
    at WithStylesInner.render (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:40960:13)
    at finishClassComponent (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:97983:31)
    at updateClassComponent (http://localhost:6006/vendors~main.79a40410d9c928a0a28b.bundle.js:97938:24)

Webpack build:

VM98094 jss-plugin-vendor-prefixer.esm.js:19 Uncaught (in promise) TypeError: Object(...) is not a function
    at Array.onProcessRule (VM98094 jss-plugin-vendor-prefixer.esm.js:19)
    at PluginsRegistry.onProcessRule (VM98068 PluginsRegistry.js:56)
    at Array.forEach (<anonymous>)
    at RuleList.process (VM98050 RuleList.js:163)
    at new StyleSheet (VM98064 StyleSheet.js:55)
    at Jss.createStyleSheet (VM98066 Jss.js:123)
    at attach (VM98037 withStyles.js:145)
    at WithStylesInner.render (VM98037 withStyles.js:310)
    at finishClassComponent (react-dom.development.js?61bb:14524)
    at updateClassComponent (react-dom.development.js?61bb:14479)

Steps to Reproduce 🕹

Not sure how to reproduce this issue. It do not happen on SSR and not in NextJS (I use @material-ui/styles in multiple projects).

But when I check my package-lock.json, I notice that css-vendor (where one of the errors is coming from) is installed in 0.3.8. But supportedKeyframes was added later. So I guess my packages are messed up.

package.json

"dependencies": {
    "@babel/runtime": "^7.3.1",
    "@grapes-agency/app-frame-messages": "^1.3.2",
    "@lmachens/react-grid-layout": "^0.16.7",
    "@material-ui/core": "^3.9.1",
    "@material-ui/icons": "^3.0.2",
    "@material-ui/styles": "^3.0.0-alpha.9",
    "ajv": "^6.7.0",
    "cors": "^2.8.5",
    "es6-object-assign": "^1.1.0",
    "event-source-polyfill": "^1.0.5",
    "express": "^4.16.4",
    "lodash": "^4.17.11",
    "oidc-client": "^1.6.1",
    "promise-polyfill": "8.1.0",
    "qs": "^6.6.0",
    "react": "^16.8.0-alpha.1",
    "react-document-title": "^2.0.3",
    "react-dom": "^16.8.0-alpha.1",
    "react-jss": "^8.6.1",
    "react-loadable": "^5.5.0",
    "react-router-dom": "^4.3.1",
    "react-swipeable-views": "^0.13.1",
    "serve-favicon": "^2.5.0",
    "ua-parser-js": "^0.7.19",
    "uniforms": "^1.31.0",
    "uniforms-material": "^1.31.0",
    "web-push": "^3.3.3"
  },

package-lock.json

 "css-vendor": {
      "version": "0.3.8",
      "resolved": "https://registry.npmjs.org/css-vendor/-/css-vendor-0.3.8.tgz",
      "integrity": "sha1-ZCHP0wNM5mT+dnOXL9ARn8KJQfo=",
      "requires": {
        "is-in-browser": "^1.0.2"
      }
    },

I tried to manual update css-vendor, but then I get this error:

Uncaught (in promise) TypeError: Cannot read property '1' of undefined
    at supportedKeyframes (VM151 supported-keyframes.js:24)
    at Array.onProcessRule (VM148 jss-plugin-vendor-prefixer.esm.js:19)
    at PluginsRegistry.onProcessRule (VM122 PluginsRegistry.js:56)
    at Array.forEach (<anonymous>)
    at RuleList.process (VM104 RuleList.js:163)
    at new StyleSheet (VM118 StyleSheet.js:55)
    at Jss.createStyleSheet (VM120 Jss.js:123)
    at attach (VM91 withStyles.js:145)
    at WithStylesInner.render (VM91 withStyles.js:310)
    at finishClassComponent (react-dom.development.js?61bb:14524)

Any idea someone?

Issue Analytics

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

github_iconTop GitHub Comments

7reactions
oliviertassinaricommented, Jan 29, 2019

@lmachens It’s coming from a JSS version mismatch. You should have JSS v10 installed over JSS v9 in your project. Remove react-jss dependency, you don’t need it.

2reactions
MohammedFaragallahcommented, Jun 19, 2019

same error solved by installing jss: 10.0.0-alpha.20

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: vendor.supportedKeyframes is not a function ...
I have searched the issues of this repository and believe that this is not a duplicate. Expected Behavior. import { install } from...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
Some pages crashes, get errors: "Uncaught TypeError: mixers ...
If I delete the Skills section, I only get "Uncaught TypeError: mixers[mixerIndex] is not a function" error, but all crashes fix. No more...
Read more >
Design Patterns with React Easy State | by Bertalan Miklos
React Easy State is a transparent reactive state management library with two functions and two accompanying rules. Always wrap your components with view()...
Read more >
react-jss - UNPKG
jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js","../../. ... node_modules/css-vendor/node_modules/@babel/runtime/helpers/esm/ ...
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