CORS issue with "webpack-dev-server": "^1.14.1"
See original GitHub issueHi everyone, I’m using:
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.8.4"
and I get the following error when I try to hit googleapis:
XMLHttpRequest cannot load http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=8&q=http://rss.cnn.com/rss/edition_entertainment.rss?output=rss. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:3000’ is therefore not allowed access.
I have added following settings in webpack.config.js:
// Webpack Config
var webpackConfig = {
headers: {
"Access-Control-Allow-Origin": "http://localhost:3000",
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Headers": "Content-Type, Authorization, x-id, Content-Length, X-Requested-With",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS"
}
… but I still getting the same error. Can anyone give me some advice please? Thank you for your time.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:23 (5 by maintainers)
Top Results From Across the Web
webpack dev server CORS issue - Stack Overflow
CORS is server issue, server does not allow access from different source. Even using different ports is considered to ... "dev-server": "webpack-dev-server ......
Read more >webpack-dev-server-cors v1.14.3 Bundlephobia
Size of webpack-dev-server-cors v1.14.3 is 712.6 kB (minified), and 272.3 kB when compressed using GZIP. Bundlephobia helps you find the performance impact ...
Read more >webpack-dev-server-cors vulnerabilities - Snyk
version published direct vulnerabilities
1.14.3 26 Feb, 2016 0. C. 0. H. 0. M. 0. L
1.14.2 26 Feb, 2016 0. C. 0. H. 0....
Read more >webpack/webpack/dev - Gitter
Hello ! I've been trying to connect to the socket in which webpack-dev-server write the errors / warnings occurring during development. Problem is...
Read more >Bypassing CORS Error with Webpack Dev Server - Medium
CORS is a way to bypass the SOP enforced by the browser in order to allow fetching scripts or resources from different domains....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Today I updated
webpack-dev-serverfrom2.4.1to2.4.3and suddenly HMR stopped working until I added this to my webpack config file:Thanks @SpaceK33z , I edit the file as follow:
Still no luck. Your advice is much appreciated.