docz: Object(...) is not a function

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

About this issue

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

Most upvoted comments

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"
  }
}

@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.

Just an update, deleting my package-lock.json and npm installing fixes my production build issue now. I figure the dependencies work together again 😄