Hey, anyone experience CORS issues in the Playgrou...
# prisma-whats-new
p
Hey, anyone experience CORS issues in the Playground? I am trying to integrate this example: https://github.com/graphcool-examples/functions/tree/master/payment-and-delivery/stripe-create-customer-es6 and am getting the following error:
Fetch API cannot load https://.../prod/create/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<https://console.graph.cool>' is therefore not allowed access. The response had HTTP status code 502. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
a
That's usually due to a syntax error in the function code. What are you trying to do?
p
Ok. I am adapting the example I linked a little bit: https://gist.github.com/pcooney10/3c4742e9f8adaf151c6354adeeb7d8d6
I saved down the initial version from example so you can see a diff
a
You can't directly deploy this function like this
Also, you cannot export anything else other than the main function
p
Ok i compiled it w/ webpack like it says in the example
But am trying a different example. Not gonna spin my wheels to hard on something that should be pretty simple
a
Did you get it working removing the extra exports?
d
from my experience it does not even work well to use ES6 imports there, I used Rollup to transpile that ... here is the config I've used ... https://gist.github.com/FredyC/e9c79301761859c111b9b1ff6880ff0e#file-rollup-config-js
oh and of course async/await does not work either, I did not manage to make it working with Rollup either, it needs to polyfill generators
yea we definitely need to get some feedback from the server when there is a syntax error, it's hard to find a culprit like this
👍 1