Error while building Pages Functions from monorepo (nx): Could not resolve
I have a monorepo that contains a Pages project and a library that the Pages _worker.js function depends on.
During the CF build I get the following error (which works fine locally).
I suspect this might be related to the module being part of a monorepo?
4 Replies
ok resolved. needed
--format=esm
not cjs
Hello @richburdon
I wanted to ask few things from you,
If I am not mistaken then you are using Cloudflare pages plus nx monorepo next.js apps right??
Actually we are also using same, we have next js several application in our nx monorepo, which we want to deploy on Cloudflare pages, but after deployment it don't work as build must be done using next-on-pages plugin.
And I am stuck on the build issue, so could you please let me know how we can achieve build for each app separately.
hi Dilip. i am using CF and NX but we're not useing next.js -- i'm using hono and other technologies.
i'm new to this, but my understanding is that w dev initiates an esbuild and will try to respect your local tsconfig rules; i don't have any experience with nextjs
i have found the people on the site to be very helpful if you give them the actual build errors you're seeing in a new thread on #general-help
if
wrangler pages dev
works for you then the GH deploy should also work so i would start there. best of luck.Thanks, let me check this, thank you for reverting back.