react 路由 webpack调试正常,打包后路由不起作用

在webpack的服务器8080端口开发调试好好的,本地80端口只能打开主页,其他路径都是报错的
[an error occurred while processing this directive] The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. [an error occurred while processing this directive]
这是页面报错信息
下面是控制台报错信息
Error in event handler for (unknown): TypeError: Cannot read property 'textContent' of null
at displayError (chrome-extension://chklaanhfefbnpoihckbnefhakgolnmc/content.js:4:99)
at chrome-extension://chklaanhfefbnpoihckbnefhakgolnmc/content.js:282:4

阅读 3k
1 个回答

单单看控制台的错误信息的话,应该是页面中用到了textContent这个字段,但是这个字段的值为null,可以看下接口响应参数中textContent字段是否有值,或者查看一下页面中用到textContent的地方,做下非空判断

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题