My application builds locally but fails remotely in vercel with this error:
13:12:54 [ERROR] [content] [GenerateContentTypesError] `astro sync` command failed to generate content collection types: Cannot find module '@types' imported from '/vercel/path0/src/content/config.ts'
Hint:
Check your `src/content/config.*` file for typos.
Error reference:
https://docs.astro.build/en/reference/errors/generate-content-types-error/
Stack trace:
at syncContentCollections (file:///vercel/path0/node_modules/.pnpm/[email protected][email protected]/node_modules/astro/dist/core/sync/index.js:104:11)
at async check (file:///vercel/path0/node_modules/.pnpm/[email protected][email protected]/node_modules/astro/dist/cli/check/index.js:25:20)
at async cli (file:///vercel/path0/node_modules/.pnpm/[email protected][email protected]/node_modules/astro/dist/cli/index.js:169:5)
Caused by:
Cannot find module '@types' imported from '/vercel/path0/src/content/config.ts'
at nodeImport (file:///vercel/path0/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-jvB8WLp9.js:54928:25)
at eval (/vercel/path0/src/content/config.ts:3:50)
ELIFECYCLE Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
The issue seems to be that Vercel is failing to resolve the path alias I've used to import types. How can I correct this without remove all aliases from my application?