Webpack dev server React Content Security Policy error

后端 未结 4 741
情歌与酒
情歌与酒 2021-01-17 19:04

I have my single page app running on webpack-dev-server. I can load and reload my entry route over at localhost:8080 and it works every time. However i can load

4条回答
  •  被撕碎了的回忆
    2021-01-17 19:40

    If you're using Rails and Webpacker and get this error, note that the initializer config/initializers/content_security_policy.rb has a Content Security Policy for Rails.env.development. Changing :https to :http on that line solved the error for me. (And remember that localhost is not the same as 127.0.0.1 as far as the CSP is concerned.)

提交回复
热议问题