Skip to content

CORS issue with DEEPL on localhost #437

@cp-bwg

Description

@cp-bwg

When I attempt a translation using a deepL key when in astro dev, running in browser on localhost, the translation service fails due to a cors issue.

Access to fetch at 'https://api-free.deepl.com/v2/translate?text=we&text=wqe&source_lang=EN&target_lang=ES&tag_handling=html&split_sentences=1&auth_key=**[REDACTED]** from origin 'http://localhost:4321' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.Understand this error
deepl.js:177

GET https://api-free.deepl.com/v2/translate?text=we&text=wqe&source_lang=EN&target_lang=ES&tag_handling=html&split_sentences=1&auth_key=**[REDACTED]** net::ERR_FAILED 200 (OK)
translate @ deepl.js:177
rP @ update.js:274
onclick @ translate-button.svelte:54
Hu @ events.js:253Understand this error
update.js:290 TypeError: Failed to fetch
at Object.translate (deepl.js:177:11)
at rP (update.js:274:50)
at HTMLButtonElement.onclick [as __click] (translate-button.svelte:54:7)
at HTMLDivElement.Hu (events.js:253:17)
rP @ update.js:290
await in rP
onclick @ translate-button.svelte:54
Hu @ events.js:253Understand this error

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions