Coder Social home page Coder Social logo

Comments (7)

poofy25 avatar poofy25 commented on June 27, 2024 4

Here (https://github.com/payloadcms/payload/discussions/6704#discussioncomment-9821934),
I opened the same exact issue about a month prior.

Basically the workaround I found is to give a website url before the image url

For example

Before:
<Image src={image.url} ...>

After
<Image src={${process.env.WEBSITE_URL}${image.url}} />

from payload.

denisprado avatar denisprado commented on June 27, 2024

Here (https://github.com/payloadcms/payload/discussions/6704#discussioncomment-9821934), I opened the same exact issue about a month prior.

Basically the workaround I found is to give a website url before the image url

For example

Before: <Image src={image.url} ...>

After <Image src={${process.env.WEBSITE_URL}${image.url}} />

Here (https://github.com/payloadcms/payload/discussions/6704#discussioncomment-9821934), I opened the same exact issue about a month prior.

Basically the workaround I found is to give a website url before the image url

For example

Before: <Image src={image.url} ...>

After <Image src={${process.env.WEBSITE_URL}${image.url}} />

Unfortunately this approach does not worked for me.

from payload.

denisprado avatar denisprado commented on June 27, 2024

Worked for me using Aws s3 adapter (I guess it will be not necessary) and adding the parâmeter loader={() => src} to the Images components.

from payload.

marvinengelmann avatar marvinengelmann commented on June 27, 2024
<Image
  src={`${process.env.NEXT_PUBLIC_URL}${image.url}`}
/>

This approach is working for me. I am using Vercel Blob store, Vercel Postgres and beta 53.

from payload.

marvinengelmann avatar marvinengelmann commented on June 27, 2024

Worked for me using Aws s3 adapter (I guess it will be not necessary) and adding the parâmeter loader={() => src} to the Images components.

As far as I know, a custom loader that just returns the image url disables Vercel image optimization.

from payload.

denisprado avatar denisprado commented on June 27, 2024

Worked for me using Aws s3 adapter (I guess it will be not necessary) and adding the parâmeter loader={() => src} to the Images components.

As far as I know, a custom loader that just returns the image url disables Vercel image optimization.

May be, but if I only disable the optimization for entire app, the error continues.. with loader, the error stopped.

from payload.

denisprado avatar denisprado commented on June 27, 2024

Now, I am using an s3 bucket and an image loader like this:

const imageLoader = ({ src, width, quality }: ImageLoaderProps) => { const params = [w=${width}]; if (quality) { params.push(q=${quality}); } const paramsString = params.join("&"); return https://${process.env.S3_BUCKET}.s3.${process.env.S3_REGION}.amazonaws.com/${src}?${paramsString}; };

to achieve image optimization. I don't think this is fully integrated with Payload's image sizes, but it makes it viable to continue using it.

from payload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.