这是indexloc提供的服务,不要输入任何密码
Skip to content

Problems when deploy to Cloudflare Pages #4

@akring

Description

@akring

Thank you for your great template!

I have a trouble when I tried to deploy it to Cloudflare Pages, here is my process and problems:

  1. run npx astro add cloudflare to add cloudflare support, and the astro.config.mjs is automaticaly change to:
export default defineConfig({
  ...
  output: "server",
  adapter: cloudflare(),
});
  1. run npm run build and get the following error:
> astro-bento-portfolio@0.0.2 build
> astro build

01:39:12 [WARN] [@astrojs/cloudflare] The current configuration does not support image optimization. To allow your project to build with the original, unoptimized images, the image service has been automatically switched to the 'noop' option. See https://docs.astro.build/en/reference/configuration-reference/#imageservice
01:39:12 Types generated 183ms
01:39:12 [build] output: "server"
01:39:12 [build] directory: /Users/xxx/Developer/Frontend/akring-astro-home/dist/
01:39:12 [build] adapter: @astrojs/cloudflare
01:39:12 [build] Collecting build info...
01:39:12 [build] ✓ Completed in 329ms.
01:39:12 [build] Building server entrypoints...
node:internal/fs/promises:628
  return new FileHandle(await PromisePrototypeThen(
                        ^

Error: ENOENT: no such file or directory, open '/Users/xxx/Developer/Frontend/akring-astro-home/dist/_astro/constants.x3V3ZnQq.js'
    at async open (node:internal/fs/promises:628:25)
    at async Object.readFile (node:internal/fs/promises:1228:14)
    at async extractFile (file:///Users/xxx/Developer/Frontend/akring-astro-home/node_modules/@unocss/vite/dist/index.mjs:334:20)
    at async Promise.all (index 2)
    at async setupContentExtractor (file:///Users/xxx/Developer/Frontend/akring-astro-home/node_modules/@unocss/vite/dist/index.mjs:358:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/xxx/Developer/Frontend/akring-astro-home/dist/_astro/constants.x3V3ZnQq.js'
}

Wish you can help me to deploy this great template to Cloudflare.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions