Closed pblair12 closed 7 years ago
I was seeing this error in both Chrome and Firefox
Access to Font at 'http://localhost:9000/dev/af7ae505a9eed503f8b8e6982036873e.woff2' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.
Because of that error I was not able to view the font awesome icons in mean2 starter.
The fix was to add headers to the webpackDevServer configuration:
{ 'Access-Control-Allow-Origin': `${config.app.url.protocol}://${config.app.url.host}:${config.app.url.port}`, 'Access-Control-Allow-Credentials': 'true' }
I think you can simplify the change to just:
headers: { 'Access-Control-Allow-Origin': '*' }
Since this is only used in dev mode, it's ok imo to allow any cross origin request.
@reblace good idea! done
I was seeing this error in both Chrome and Firefox
Because of that error I was not able to view the font awesome icons in mean2 starter.
The fix was to add headers to the webpackDevServer configuration: