Semantic-UI-React: TypeError: instance.render is not a function

Solution

See #comment

Bug Report

Steps

This is an error related to using the latest version 0.80.0 that is not present in 0.79.0. During the build process with a typical webpack build you get the error: TypeError: instance.render is not a function

Expected Result

A build as it was in 0.79.0, which is completely stable with the exact same build process.

Actual Result

The actual result that happened πŸ’£

image

Version

0.80.0 Webpack 4 Build is essentially the same as create-react-app, but with webpack 4 and decorators. Babel is using babel core 7.0.0-beta.48

Here is the babel pipeline:

    "@babel/core": "7.0.0-beta.48",
    "@babel/plugin-proposal-decorators": "7.0.0-beta.48",
    "@babel/plugin-proposal-class-properties": "7.0.0-beta.48",
    "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.48",
    "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.48",
    "@babel/plugin-transform-classes": "7.0.0-beta.48",
    "@babel/plugin-transform-destructuring": "7.0.0-beta.48",
    "@babel/plugin-transform-react-constant-elements": "7.0.0-beta.48",
    "@babel/plugin-transform-react-display-name": "7.0.0-beta.48",
    "@babel/plugin-transform-regenerator": "7.0.0-beta.48",
    "@babel/plugin-transform-runtime": "7.0.0-beta.48",
    "@babel/preset-env": "7.0.0-beta.48",
    "@babel/preset-flow": "7.0.0-beta.48",
    "@babel/preset-react": "7.0.0-beta.48",
    "babel-plugin-macros": "2.2.1",
    "babel-plugin-transform-dynamic-import": "2.0.0",
    "babel-plugin-transform-react-remove-prop-types": "0.4.13"

configured like this:

require('babel-plugin-macros'),
require('@babel/plugin-transform-destructuring').default,
[require('@babel/plugin-proposal-decorators'), { legacy: true }],
[require('@babel/plugin-proposal-class-properties').default,{loose: true}],
[require('@babel/plugin-proposal-object-rest-spread').default,{useBuiltIns: true}],
[require('@babel/plugin-transform-runtime').default,{
          helpers: false,
          polyfill: false,
          regenerator: true}],
require('@babel/plugin-syntax-dynamic-import').default

Stacktrace

Uncaught TypeError: instance.render is not a function
    at finishClassComponent (react-dom.development.js:13085)
    at updateClassComponent (react-dom.development.js:13047)
    at beginWork (react-dom.development.js:13715)
    at performUnitOfWork (react-dom.development.js:15741)
    at workLoop (react-dom.development.js:15780)
    at HTMLUnknownElement.callCallback (react-dom.development.js:100)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:138)
    at invokeGuardedCallback (react-dom.development.js:187)
    at replayUnitOfWork (react-dom.development.js:15194)
    at renderRoot (react-dom.development.js:15840)
    at performWorkOnRoot (react-dom.development.js:16437)
    at performWork (react-dom.development.js:16358)
    at performSyncWork (react-dom.development.js:16330)
    at requestWork (react-dom.development.js:16230)
    at scheduleWork$1 (react-dom.development.js:16096)
    at scheduleRootUpdate (react-dom.development.js:16663)
    at updateContainerAtExpirationTime (react-dom.development.js:16690)
    at updateContainer (react-dom.development.js:16717)
    at ReactRoot.push../node_modules/react-dom/cjs/react-dom.development.js.ReactRoot.render (react-dom.development.js:17000)
    at react-dom.development.js:17140
    at unbatchedUpdates (react-dom.development.js:16557)
    at legacyRenderSubtreeIntoContainer (react-dom.development.js:17136)
    at Object.render (react-dom.development.js:17195)
    at Object../src/index.js (index.js:27)
    at __webpack_require__ (bootstrap:767)
    at fn (bootstrap:141)
    at Object.0 (validator-list.js:81)
    at __webpack_require__ (bootstrap:767)
    at checkDeferredModules (bootstrap:43)
    at Array.webpackJsonpCallback [as push] (bootstrap:30)
    at main.chunk.js:1

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (10 by maintainers)

Most upvoted comments

The problem is caused by the recent release of @babel@7.0.0-beta.48, the immediately fix is below.

  1. Add following lines to the package.json
+"resolutions": {
+  "@babel/runtime": "7.0.0-beta.46"
+},
  1. Run yarn
  2. Restart yarn start

PR with deps updates is comming.

Released in semantic-ui-react@0.80.2. Please verify the fix and we can close this issue.

When we can expect new version in place?

The matching PR was merged, I hope that it will be released soon πŸ™Œ

Thanks folks πŸ‘

@the-simian Thanks for the attention to this issue.

You closed the first issue within minutes and no investigation

You’re not right there, I’ve go to codesandbox and test it, it worked fine πŸ˜• Then I tested it locally and it failed πŸ’©

Let’s reduce the degree of the discussion, everyone has the right to a mistake πŸ‘ I’m working on it right now.

Thanks for the quick fix! Almost nuked my project to clean state, the thrill of living on the edge πŸ˜ƒ

Just tested it and Its working I had the same error as OP. @levithomason

@levithomason Fix is working for us. Thanks for the fast fix!