megastruktur / foundryvtt-simple-name-generator

A simple name generator Macros for you and your FoundryVTT campaign
3 stars 5 forks source link

TypeError: Failed to fetch - Access to fetch has been blocked by CORS policy #7

Open kiloforce opened 1 year ago

kiloforce commented 1 year ago

Trying to use the Simple Name Generator module, but getting the following error:

Access to fetch at 'https://wa1z1p0757.execute-api.eu-west-1.amazonaws.com/dev/akan/female' from origin 'https://vtt.myserver.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
VM332423:1          GET https://wa1z1p0757.execute-api.eu-west-1.amazonaws.com/dev/akan/female net::ERR_FAILED 403
(anonymous) @ VM332423:1
generateSimpleName @ simple-name-generator.js:15
eval @ VM349763:3
_executeScript @ foundry.js:19935
execute @ foundry.js:19890
_onExecute @ foundry.js:64841
await in _onExecute (async)
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2
VM332423:1                  Uncaught (in promise) TypeError: Failed to fetch
[Detected 1 package: simple-name-generator]
    at <anonymous>:1:876
    at SimpleNameGeneratorMacros.generateSimpleName (simple-name-generator.js:15:28)
    at Macro.eval (eval at _executeScript (foundry.js:19933:16), <anonymous>:3:27)
    at Macro._executeScript (foundry.js:19935:17)
    at Macro.execute (foundry.js:19890:21)
    at MacroConfig._onExecute (foundry.js:64841:17)

image

Is this something I can fix from my side? A quick google search seems to imply this needs to be adjusted on the Amazon configuration side? ( https://aws.amazon.com/premiumsupport/knowledge-center/no-access-control-allow-origin-error/ )

FoundryVTT v10.286. Simple Name Generator v4.0.1

weepingminotaur commented 1 year ago

Getting the same error as well.