Skip to content
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

IPX returns a '403: Fetch error' during static generation for image urls containing special characters #815

Open
arthurmchr opened this issue Apr 27, 2023 · 3 comments

Comments

@arthurmchr
Copy link

nuxt: 3.4.0
@nuxt/image-edge: 1.0.0-28020728.5df24eb

In my nuxt.config.ts I have :

modules: ['@nuxt/image-edge'],
image: {
  domains: ['cdn.discordapp.com'],
}

In my app.vue file I only have the following :

<template>
  <div>
    <nuxt-img src="https://cdn.discordapp.com/my-image.png?test=ok"
    />
  </div>
</template>

It works well in development.

But when I execute the npm run generate command to export a static version of my site, during the prerendering, I get

[nitro 11:52:32]   ├─ /_ipx/_/https://cdn.discordapp.com/my-image.png%3Ftest=ok (205ms) (Error: [403] IPX: Fetch error)

The error appears because of the replacement of the ? character in my URL by %3F.
I will get the same error for all file with a (SPACE) character in the name, or special characters in it.
I got the same result on other domain too (not only cdn.discordapp.com)

@arthurmchr arthurmchr changed the title IPX returns a '403: Fetch error' during static generation for image urls contai special characters IPX returns a '403: Fetch error' during static generation for image urls containing special characters Apr 27, 2023
@arthurmchr
Copy link
Author

Removing encodePath in https://github.com/nuxt/image/blob/main/src/runtime/providers/ipx.ts (line 33) seems to fix it.

@maartenvanasperen
Copy link

Removing encodePath in https://github.com/nuxt/image/blob/main/src/runtime/providers/ipx.ts (line 33) seems to fix it.

I got the same issue, and removing the encodePath seems to fix it. It only occurs with ssg and not with a dev build

@McSundae
Copy link

I have the exact same problem, but i dont think it would be right to make changes in those files to fix this problem. There needs to be some sort of option to fix that problem that we are just missing out...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants