Closed protoEvangelion closed 4 years ago
Hi @protoEvangelion, I believe this is due to Content-Security-Policy. See https://github.com/single-spa/create-single-spa/pull/44 and this documentation. If you would rather not deal with CSP and just want things to work, you can comment out or remove the content security policy.
cc @filoxo, who authored this. I am closing this issue because there is no bug here. But feel free to comment further or reopen.
@joeldenning Thanks for the docs & explanation. There is no CSP meta tag though in the demo repo: https://github.com/react-microfrontends/root-config/blob/master/src/index.ejs
Not a huge deal but it would be nice if the recommended demo repo worked for newcomers like myself :)
Oops I misread this! This is a CORS error, not CSP!
There is nothing that we could do to make the swapi API work with CORS. The swapi API itself would have to send the correct CORS response headers in order for you to be able to call it.
You can read more about CORS at https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS - it is something that is implemented by the browser, not single-spa.
Actually, this appears to just be that swapi is no longer working. The readme even says that it's no longer maintained: https://github.com/phalt/swapi
Edit: I'll open up a new issue on the react-microfrontends repo and discuss ideas for what to do.
Oh haha good catch I didn’t even realize that it was our code calling swapi. This must have stopped working recently.
I’ve been wrong a couple times on this. Yes let’s fix this - I see you create an issue over in the example repo.
Getting this error when generating a react application & when going directly to the example react microfrontend: https://react.microfrontends.app/people
I'm not sure if the SWAPI api is down or if it's actually a CORS issue.
When navigating to the swapi docs page or api, it looks like a blank heroku site:
https://swapi.co/documentation