Skip to content

Cloudflare with pnpm run generate works, but not pnpm run build #2164

@mrleblanc101

Description

@mrleblanc101

Hi,
I'm deploying this repo to Cloudflare pages and I noticed sudently that my images were not the correct size. I think this is because we changed from SSG to SSR since our website is connected to a backend, and we like to have the data up-to-date without regenerating and redeploying the website.

Local using pnpm run dev
Local using pnpm run build && node .output/server/index.mjs
Local using pnpm run generate && npx serve .output/public
Cloudfalre using pnpm run generate

Image

Cloudflare using pnpm run build 🚫

Image

As you can see, when using pnpm run build on Cloudflare pages, the URL are going to the CMS (prismic) and are not processed.
Am I missunderstanding something ? Because it works in all mode on my local machine (dev/build/generate).

I'm using the Cloudflare git integration to deploy:

Image

And this is my Cloudflare config (default):

Image

My nuxt.config.js for nuxt/image, you can see the complete file in the linked repo above:

export default defineNuxtConfig({
    ...
    image: {
        provider: 'ipx',
        domains: ['static.swapcard.com', 'images.prismic.io', 'interface-qc.cdn.prismic.io'],
        quality: 90,
        format: ['webp'],
    },
    ...
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions