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 doesn't generate images in Cloudflare Pages SSG build process #866

Open
Smef opened this issue Jun 12, 2023 · 2 comments
Open

IPX doesn't generate images in Cloudflare Pages SSG build process #866

Smef opened this issue Jun 12, 2023 · 2 comments

Comments

@Smef
Copy link

Smef commented Jun 12, 2023

It seems that images generation is skipped when running nuxi generate when run on Cloudflare Pages. This process is triggered by the CFP build process running npm run generate. During this process, the generate process runs successfully, but no _ipx urls seem to be hit and the images are not generated.

This works fine with version 1.0.0-28059208.2abef1b but seems to have an issue with RC1

Cloudflare Pages build process is running node 18.16.0

The generate command runs successfully and generates all images when running locally.

Here's the first part of the build log for reference:, where we can see the node environment and the generate command.

18:38:22.990 | Success: Finished cloning repository files
-- | --
18:38:24.380 | Detected the following tools from environment: nodejs@18.16.0, npm@9.5.1
18:38:24.381 | Installing project dependencies: npm clean-install --progress=false
18:38:49.622 |  
18:38:49.623 | > postinstall
18:38:49.623 | > nuxi prepare
18:38:49.623 |  
18:38:49.744 | [log] Nuxi 3.5.3
18:38:52.252 | [success] Types generated in .nuxt
18:38:52.312 |  
18:38:52.313 | added 911 packages, and audited 1664 packages in 26s
18:38:52.313 |  
18:38:52.313 | 221 packages are looking for funding
18:38:52.313 | run `npm fund` for details
18:38:52.410 |  
18:38:52.410 | 50 vulnerabilities (1 low, 20 moderate, 19 high, 10 critical)
18:38:52.410 |  
18:38:52.410 | To address issues that do not require attention, run:
18:38:52.411 | npm audit fix
18:38:52.411 |  
18:38:52.411 | To address all issues (including breaking changes), run:
18:38:52.411 | npm audit fix --force
18:38:52.411 |  
18:38:52.411 | Run `npm audit` for details.
18:38:52.437 | Executing user command: bash build.sh
18:38:53.792 |  
18:38:53.792 | > generate
18:38:53.792 | > nuxi generate
18:38:53.793 |  
18:38:53.903 | [log] Nuxi 3.5.3
18:38:53.935 | [log] Nuxt 3.5.3 with Nitro 2.4.1
18:38:55.336 | [warn] Using experimental payload extraction for full-static output. You can opt-out by setting `experimental.payloadExtraction` to `false`.
18:38:57.683 | [info] Building client...
18:38:57.701 | [info] vite v4.3.9 building for production...
18:38:58.024 | [info] transforming...
18:39:04.868 | [info] ✓ 717 modules transformed.
18:39:05.126 | [info] rendering chunks...
18:39:05.286 | [info] computing gzip size...
@Smef
Copy link
Author

Smef commented Jun 13, 2023

It looks like this is the commit which broke this:
feat: add none provider and only enable ipx when node present (#840)
cc94e70

@Smef
Copy link
Author

Smef commented Jun 13, 2023

It looks like this issue is with nitro not thinking it's in a node environment. Forcing this config value to true seems to resolve this issue

export default defineNuxtConfig({
    nitro: {
        node: true,
    },
})

src/module.ts line 134 in the current version

        imageOptions.provider = options.provider = nitro.options.node ? 'ipx' : 'none'

This line seems to be forcing the provider to none, even though IPX works fine. This might be considered an issue with nitro, which should be reporting true instead of false for this node option.

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

1 participant