#Switching from static to server fails on vercel

15 messages · Page 1 of 1 (latest)

haughty flame
#

I switched the output from static to server and run npx astro add vercel. When I pushed the changes I got the following error on vercel:

[15:26:38.610] 03:26:38 PM [build] Waiting for the @astrojs/vercel/serverless integration...
[15:26:39.315]  error   Failed to parse /vercel/path0/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html as script:
[15:26:39.315]   Unexpected token (1:0)
[15:26:39.315] Error: Failed to parse /vercel/path0/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html as script:
[15:26:39.316] Unexpected token (1:0)
[15:26:39.316]     at Object.analyze [as default] (/vercel/path0/node_modules/@vercel/nft/out/analyze.js:226:30)
[15:26:39.316]     at Job.emitDependency (/vercel/path0/node_modules/@vercel/nft/out/node-file-trace.js:301:52)
[15:26:39.316]     at async /vercel/path0/node_modules/@vercel/nft/out/node-file-trace.js:336:21
[15:26:39.316]     at async Promise.all (index 30)
[15:26:39.316]     at async Job.emitDependency (/vercel/path0/node_modules/@vercel/nft/out/node-file-trace.js:307:9)
[15:26:39.316]     at async /vercel/path0/node_modules/@vercel/nft/out/node-file-trace.js:336:21
[15:26:39.317]     at async Promise.all (index 6)
[15:26:39.317]     at async Job.emitDependency (/vercel/path0/node_modules/@vercel/nft/out/node-file-trace.js:307:9)
[15:26:39.317]     at async /vercel/path0/node_modules/@vercel/nft/out/node-file-trace.js:336:21
[15:26:39.317]     at async Promise.all (index 4)
[15:26:39.348] error Command failed with exit code 1.
[15:26:39.348] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[15:26:39.366] Error: Command "yarn run build" exited with 1
signal coyote
#

Hi @haughty flame I think the problem maybe coming from @mapbox not astro

haughty flame
#

Thanks @signal coyote , I inspected and the dependency is due to vercel/nft which in turn is a dependency of @astrojs/vercel

signal coyote
#

ah, okay, could u provide a reproduction if possible

haughty flame
#

I will try to setup a new project and see if I can replicate it from scratch

haughty flame
#

I rebuild everything from scratch with newer version and the error went away.

#

Nonetheless, I had to keep using "@astrojs/image": "^0.7.0" instead of "@astrojs/image": "^0.11.0" (or any version in between!)

#

I kept getting an error when running developer mode in my macbook M1 Pro

#

the issue was related with napi-rs

signal coyote
#

very interesting, please keep me informed if this keeps persisting, 👊

fresh violet
#

I'm getting this same issue, any idea of a workaround?

signal coyote
#

oh wow, in this case would either @fresh violet or @haughty flame be willing to submit an issue for this,

#

!issue

loud spindleBOT
signal coyote
#

If you can provide as much detail as possible we will take a look at it ty