Cannot deploy on pages after installing remix-pwa

I followed this guide (https://developers.cloudflare.com/pages/framework-guides/deploy-a-remix-site/) to create a Remix app and it could deploy on cloudflare page successfully When I try to introduce Remix PWA https://remix-pwa.run/docs/installation The deployment has error
11:02:27.663 ✘ [ERROR] 1 error(s) and 0 warning(s) when compiling Worker.
11:02:27.664
11:02:27.664
11:02:27.667
11:02:27.668 ✘ [ERROR] Could not resolve "../build/server"
11:02:27.668
11:02:27.668 [[path]].ts:6:23:
11:02:27.668 6 │ import * as build from '../build/server';
11:02:27.668 ╵ ~~~~~~~~~~~~~~~~~
11:02:27.669
11:02:27.669
11:02:27.670 ✘ [ERROR] Build failed with 1 error:
11:02:27.670
11:02:27.670 [[path]].ts:6:23: ERROR: Could not resolve "../build/server"
11:02:27.663 ✘ [ERROR] 1 error(s) and 0 warning(s) when compiling Worker.
11:02:27.664
11:02:27.664
11:02:27.667
11:02:27.668 ✘ [ERROR] Could not resolve "../build/server"
11:02:27.668
11:02:27.668 [[path]].ts:6:23:
11:02:27.668 6 │ import * as build from '../build/server';
11:02:27.668 ╵ ~~~~~~~~~~~~~~~~~
11:02:27.669
11:02:27.669
11:02:27.670 ✘ [ERROR] Build failed with 1 error:
11:02:27.670
11:02:27.670 [[path]].ts:6:23: ERROR: Could not resolve "../build/server"
Please anyone can help?
Cloudflare Docs
Deploy a Remix site · Cloudflare Pages docs
Remix is a framework that is focused on fully utilizing the power of the web. Like Cloudflare Workers, it uses modern JavaScript APIs, and it places …
Get Started with Remix PWA - Remix PWA
Remix PWA is a compiler that bundles your service workers as well as provide utilities and modules to build your application.
2 Replies
Erisa
Erisa3mo ago
Does it build locally? Sounds like a remix issue rather than a Cloudflare one
tony
tony3mo ago
Yes, it works on local - pnpm run build - pnpm run preview I am asking here because it is inside /function/[[path]].ts
import { createPagesFunctionHandler } from '@remix-run/cloudflare-pages';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - the server build file is generated by `remix vite:build`
// eslint-disable-next-line import/no-unresolved
import * as build from '../build/server';

export const onRequest = createPagesFunctionHandler({ build });
import { createPagesFunctionHandler } from '@remix-run/cloudflare-pages';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - the server build file is generated by `remix vite:build`
// eslint-disable-next-line import/no-unresolved
import * as build from '../build/server';

export const onRequest = createPagesFunctionHandler({ build });
Is it possible that the /build/server was not build or served on Cloudflare Pages?