React Router - Content Security Policy directive: "default-src 'self'

前端 未结 4 2061
自闭症患者
自闭症患者 2021-01-16 05:25

I\'m testing out react router and I created 2 dummy components. The home path works fine, but when I try to go to the /second path, it gives the following erro

4条回答
  •  我在风中等你
    2021-01-16 05:49

    Try to add "historyApiFallback: true" in your webpack.config. It worked for me.

    devServer: {
        historyApiFallback: true,
        stats: options.stats,
        hot: true,
        contentBase: './dist',
        watchOptions: {
          ignored: /node_modules/
        }
      }
    

提交回复
热议问题