electrode-io / electrode

Web applications with node.js and React
Other
2.1k stars 300 forks source link

TypeError: Cannot read properties of undefined (reading 'location') #1868

Open minaairsupport opened 2 years ago

minaairsupport commented 2 years ago

Describe the bug I got this error after app creation

TypeError: Cannot read properties of undefined (reading 'location')
    at ReduxRouterEngine.render (CWD/node_modules/electrode-redux-router-engine/lib/redux-router-engine.js:125:35)
    at module.exports (CWD/src/server/views/index-view.jsx:25:23)
    at getContent (CWD/node_modules/electrode-react-webapp/lib/react/content.js:26:17)
    at Token.INITIALIZE (CWD/node_modules/electrode-react-webapp/lib/react/token-handlers.js:98:12)
    at renderNext (CWD/node_modules/electrode-react-webapp/lib/render-execute.js:43:66)
    at CWD/node_modules/electrode-react-webapp/lib/render-execute.js:66:12
    at executeRenderSteps (CWD/node_modules/electrode-react-webapp/lib/render-execute.js:64:10)
    at Renderer.render (CWD/node_modules/electrode-react-webapp/lib/renderer.js:81:12)
    at CWD/node_modules/electrode-react-webapp/lib/async-template.js:81:31
From previous event:
    at DefaultHandleRoute (CWD/node_modules/electrode-react-webapp/lib/hapi/plugin17.js:17:6)
    at handler (CWD/node_modules/electrode-react-webapp/lib/hapi/register-routes.js:36:16)
    at module.exports.internals.Manager.execute (CWD/node_modules/hapi/lib/toolkit.js:35:106)
    at Object.internals.handler (CWD/node_modules/hapi/lib/handler.js:50:48)
    at exports.execute (CWD/node_modules/hapi/lib/handler.js:35:36)
    at Request._lifecycle (CWD/node_modules/hapi/lib/request.js:263:62)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Request._execute (CWD/node_modules/hapi/lib/request.js:170:9)

To Reproduce just start brand new application clap dev

Expected behavior to be running normally

Example report:

System:

Electrode Package Versions

{
  "name": "large-app",
  "version": "0.0.1",
  "description": "test app using electro",
  "homepage": "",
  "author": {
    "name": "Mina Fawzy",
    "email": "",
    "url": ""
  },
  "contributors": [],
  "files": [
    "server",
    "src",
    "lib",
    "dist"
  ],
  "main": "lib/server/index.js",
  "keywords": [],
  "repository": {
    "type": "git",
    "url": "minafaw/largeApp"
  },
  "license": "Apache-2.0",
  "engines": {
    "node": ">= 8",
    "npm": ">= 5"
  },
  "scripts": {
    "build": "clap build",
    "prod-start": "NODE_ENV=production clap -n -x electrode/build prod",
    "start": "if test \"$NODE_ENV\" = \"production\"; then npm run prod-start; else clap dev; fi",
    "test": "clap check",
    "coverage": "clap check",
    "prod": "echo 'Starting standalone server in PROD mode'; NODE_ENV=production node ./lib/server/",
    "heroku-postbuild": "clap build"
  },
  "dependencies": {
    "@loadable/component": "^5.7.0",
    "@loadable/server": "^5.9.0",
    "bluebird": "^3.4.6",
    "electrode-archetype-react-app": "7.0.0-beta7.0",
    "electrode-confippet": "^1.5.0",
    "electrode-cookies": "^1.0.0",
    "electrode-react-webapp": "^3.2.0",
    "electrode-redux-router-engine": "^3.0.0",
    "electrode-server": "^2.2.0",
    "electrode-static-paths": "^2.0.1",
    "electrode-ui-config": "^1.1.2",
    "good": "^8.1.1",
    "good-console": "^7.1.0",
    "inert": "^5.1.2",
    "lodash": "^4.17.11",
    "milligram": "^1.3.0",
    "react-notify-toast": "^0.5.0",
    "react-router-config": "^5.1.1",
    "react-router-dom": "^5.1.2"
  },
  "devDependencies": {
    "@loadable/babel-plugin": "^5.10.0",
    "@loadable/webpack-plugin": "^5.7.1",
    "electrode-archetype-react-app-dev": "7.0.0-beta7.0"
  }
}