Next build succeeds but it fails to "find a module"?
I got a Next 13 app with Server components, everything was working fine and then I started getting errors on my builds (look at the last line)
17 Replies
Please can you try deploying using
wrangler@3
with npx wrangler@3 pages deploy .vercel/output/static
, looks like an issue that was caused by wrangler@2
The
wrangler
installed in package.json
is v^3.0.1
and the builds are triggered automatically with git commits (Github).Using the Pages Git CI I assume? If so, I believe that uses wrangler@2 when deploying the built application
Hmm, even if I'm using the
v2 beta
build environment?
even then, shouldn't it use the version specified in the package.json
?Good question, not quite sure. Nevertheless, please can you try deploying using wrangler@3 locally?
Are you on Windows by any chance?
yes, atm since I'm away from my home machine
I can try in a Github Codespace tho
Argh, yeah, that'll be why. Vercel's CLI isn't very windows friendly sadly - I actually had to switch to using Ubuntu via WSL because of it :/
imma try locally deploy on a Github Codespace
It "deploys" correctly, I had to create a separate "pages project" since I didn't have a
wrangler.toml
file I guess, and prob asset uploading is not compatible with the git integration.
but back to the original problem, is it that the Pages CI is not using the wrangler
specified in the package.json
then?I don't think it has any consideration for that when deploying, I believe it just uses the version that the build image has, which at the moment is one of the v2 ones.
fwiw, you should be able to choose an existing project when deploying with wrangler
is there a way to override it? with a env var or flag?
You could use the
--project-name
flag
Well you replied to one message and i replied assuming it was the other 😅
I don't think you can change which wrangler the build image uses, but I'm probably not the best person to speak on thatit does work
so I have to manually deploy
while there is a way for the CI to use wrangler v3
Afraid so at the moment. You could also create a github action to deploy automatically on pushes, using something like https://github.com/cloudflare/pages-action
Hopefully at some point in the near future this will no longer be an issue 🙂
thanks a lot, very fast and helpful
🙂