【问题标题】:Cant open html file after webpackwebpack后无法打开html文件
【发布时间】:2022-01-14 05:43:37
【问题描述】:

我已将项目编译到 dist 文件夹中,并希望从 html 文件启动该站点。使用服务器语言环境时,一切正常,但是当您运行 html 时,会发出错误并且页面无法加载。有什么问题?

Uncaught DOMException: Failed to execute 'replaceState' on 'History': 
A history state object with URL 'file:///C:/404' cannot be created in a document with origin 'null' and URL

【问题讨论】:

标签: javascript reactjs webpack react-router


【解决方案1】:

一切正常,我把浏览器路由器换成了 HashRouter

【讨论】:

    猜你喜欢
    • 2019-01-06
    • 2013-08-08
    • 2015-04-02
    • 2013-12-05
    • 2022-08-13
    • 2023-01-31
    • 2018-01-03
    • 1970-01-01
    • 2016-03-05
    相关资源
    最近更新 更多