Next.js Discord

Discord Forum

project builds locally but breaks building on vercel

Unanswered
Russian Blue posted this in #help-forum
Open in Discord
Russian BlueOP
18:35:36.377 
src/types.ts(4,88): error TS2307: Cannot find module './schema.js' or its corresponding type declarations.
18:35:36.405 
/vercel/path0/packages/server:
18:35:36.405 
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @satori/server@0.1.0 build: `tsc`
18:35:36.405 
Exit status 2
18:35:36.432 
 ELIFECYCLE  Command failed with exit code 2.
18:35:36.455 
Error: Command "pnpm run build" exited with 2

5 Replies

Haddock
Please look for the exact filename, and it's correctly written as schema.js. Look out if it's wrring in Schema.js, or schema.ts, or whatever.
Russian BlueOP
@Haddock the file is callled
schema.ts


and i export it like this
// Re-export schema types
export type { Item, NewItem, Memory, NewMemory, KnowledgeItem, NewKnowledgeItem } from './schema';
Haddock
Then please look for where the schema.ts is used.
Because it's being called as schema.js
not schema.ts