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.

Object(...) is not a function

See original GitHub issue

Bug Report

After update from 0.8.0 to 0.9.0 and still present in the latest 0.11.0

Open localhost and get the trace on the screen

Stack trace
in BrowserRouter (created by DoczTheme)
in DataServer (created by DoczTheme)
in CopyOnWriteStoreProvider (created by DoczTheme)
in ErrorBoundary (created by DoczTheme)
in DoczTheme (at root.jsx:7)
in Root (created by HotExportedRoot)
in AppContainer (created by HotExportedRoot)
in HotExportedRoot (at index.jsx:17)

The trace in the console

BrowserRouter.js?a051:29 Uncaught TypeError: Object(...) is not a function
    at new BrowserRouter (BrowserRouter.js?a051:29)
    at new BrowserRouter (eval at <anonymous> (react-hot-loader.development.js?0a98:1761), <anonymous>:5:7)
    at constructClassInstance (react-dom.development.js?61bb:11448)
    at updateClassComponent (react-dom.development.js?61bb:13145)
    at beginWork (react-dom.development.js?61bb:13825)
    at performUnitOfWork (react-dom.development.js?61bb:15864)
    at workLoop (react-dom.development.js?61bb:15903)
    at HTMLUnknownElement.callCallback (react-dom.development.js?61bb:100)
    at Object.invokeGuardedCallbackDev (react-dom.development.js?61bb:138)
    at invokeGuardedCallback (react-dom.development.js?61bb:187)

doczrc.js

export default {
  src: './app',
};

Readme.mdx

# Hello

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mateusmouracommented, Dec 21, 2018

Using version @0.13.5:

image

package.json:

{
  "devDependencies": {
    "@babel/cli": "^7.0.0",
    "@babel/core": "^7.0.0",
    "@babel/node": "^7.0.0",
    "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
    "@babel/plugin-transform-exponentiation-operator": "^7.0.0",
    "@babel/polyfill": "^7.0.0",
    "@babel/preset-env": "^7.0.0",
    "@babel/preset-react": "^7.0.0",
    "@babel/register": "^7.0.0",
    "babel-core": "^7.0.0-bridge.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^23.4.2",
    "babel-loader": "^8.0.0",
    "babel-plugin-dynamic-import-node": "^2.0.0",
    "cross-env": "^5.2.0",
    "cypress": "^3.1.3",
    "dotenv": "^6.1.0",
    "enzyme": "^3.7.0",
    "enzyme-adapter-react-16": "^1.7.0",
    "enzyme-to-json": "^3.3.5",
    "eslint": "^5.3.0",
    "eslint-config-airbnb": "^17.0.0",
    "eslint-plugin-cypress": "^2.0.1",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-react": "^7.10.0",
    "extract-text-webpack-plugin": "^4.0.0-beta.0",
    "font-awesome": "^4.7.0",
    "husky": "^1.2.0",
    "identity-obj-proxy": "^3.0.0",
    "jest": "^23.6.0",
    "jsdom": "^13.0.0",
    "lint-staged": "^8.1.0",
    "react-test-renderer": "^16.6.3",
    "redux-mock-store": "^1.5.3",
    "uglifyjs-webpack-plugin": "^2.0.1",
    "webpack-cli": "^3.1.2",
    "webpack-dev-middleware": "^3.4.0",
    "webpack-dev-server": "^3.1.10",
    "webpack-hot-middleware": "^2.24.3",
    "why-did-you-update": "^1.0.6"
  },
  "dependencies": {
    "async": "^2.6.1",
    "autoprefixer": "^9.4.2",
    "axios": "^0.18.0",
    "chain-function": "^1.0.1",
    "chart.js": "^2.7.3",
    "classnames": "^2.2.6",
    "compression": "^1.7.3",
    "cookie-parser": "^1.4.3",
    "cross-env": "^5.2.0",
    "css-loader": "^1.0.1",
    **"docz": "^0.13.5",
    "docz-plugin-css": "^0.11.0",
    "docz-theme-default": "^0.13.5",**
    "es6-promise": "^4.2.5",
    "express": "^4.16.4",
    "file-loader": "^2.0.0",
    "google-maps": "^3.3.0",
    **"history": "^3.3.0",**
    "html2canvas": "^1.0.0-alpha.12",
    "jquery": "^3.3.1",
    "js-cookie": "^2.2.0",
    "json-loader": "^0.5.7",
    "lodash": "^4.17.11",
    "moment": "^2.22.2",
    "node-sass": "^4.10.0",
    "normalizr": "^3.3.0",
    "oboe": "^2.1.4",
    "parse-link-header": "^1.0.1",
    "postcss-load-config": "^2.0.0",
    "postcss-loader": "^3.0.0",
    "prop-types": "^15.6.2",
    "pubsub-js": "^1.7.0",
    "radium": "^0.25.0",
    **"react": "^16.6.3",**
    "react-animate-on-scroll": "^2.1.5",
    "react-chartjs-2": "^2.7.4",
    "react-custom-scrollbars": "^4.2.1",
    "react-dom": "^16.6.3",
    "react-ga": "^2.5.6",
    "react-hot-loader": "^4.3.12",
    "react-input-mask": "^2.0.4",
    "react-notification-system": "^0.2.17",
    "react-reconciler": "^0.17.2",
    "react-redux": "^5.1.1",
    **"react-router": "^3.2.0",**
    "react-slick": "^0.23.2",
    "react-sortable-hoc": "^0.8.4",
    "react-tippy": "^1.2.3",
    "react-transition-group": "^2.5.0",
    "react-typist": "^2.0.4",
    "redux": "^3.7.2",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "sass-loader": "^7.1.0",
    "socket.io-client": "^2.2.0",
    "style-loader": "^0.23.1",
    "url-loader": "^1.1.2",
    "url-template": "^2.0.8",
    "uuid": "^3.3.2",
    "velocity-animate": "^1.5.2",
    "webpack": "^4.27.0"
  }
}
1reaction
denisborovikovcommented, Aug 27, 2018

@nicholasess Tried to wipe node_modules and reinstalled completely, removed .docz and none of it helped in my case. The error rises in dev mode not in production as others mentioned before. Seems some kind of modules incompatibility.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript "Uncaught TypeError: object is not a function ...
Try to have the function body before the function call in your JavaScript file.
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 >
TypeError: Object(...) is not a function · Issue #14484 - GitHub
What is the current behaviour? I have created react functional component and implement state full logic using useState method but it throws an ......
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or...
Read more >
JavaScript: Uncaught TypeError: n is not a function
This error occurs if you try to execute a function that is not initialized or is not initialized correctly. This means that the...
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