-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parcel server starts without CORS enabled #2550
Comments
It should work by default: parcel/packages/core/parcel-bundler/src/Server.js Lines 23 to 33 in 6cbf2a6
|
I was not able to reproduce that Parcel doesn't allow other origins. My assumption is that @roscom tries to query another website from their parcel server and the other website doesn't allow the origin. |
It looks like Parcel does not send CORS headers when a file wasn't found, which can lead to confusing errors in the browser as the CORS errors obscure the 404 error |
changed this to good first feature as errors should probably also have cors headers |
Hey @DeMoorJasper, thank you for your amazing work on parcel, I would like to work on this issue, can you give a piece of advice where I should start? |
You could call |
β Question
when starting parcel serve, is there a way/undocumented option to set the CORS policy as in:
access-control-allow-origin: *
π¦ Context
I have a cycle.js app querying an external URL and I use parcel index.html as the dev server. ?
Unforunately, the CORS policy is not set and therefore the the app is blocked from accessing the data.
π» Code Sample
π Your Environment
package.json:
{
"name": "wikipedia",
"version": "1.0.0",
"description": "search wikipedia",
"main": "index.js",
"scripts": {
"start": "parcel -p 1235 index.html",
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": [],
"author": "cb",
"license": "ISC",
"dependencies": {
"@cycle/dom": "^22.3.0",
"@cycle/http": "^15.1.0",
"@cycle/run": "^5.2.0",
"npm": "^6.6.0",
"xstream": "^11.10.0"
},
"devDependencies": {}
}
The text was updated successfully, but these errors were encountered: