Hi Speckle Developers,
I’m trying to set up a local development environment for the Speckle server, specifically running yarn build
(from the root).
I’m currently using:
- Node.js v22.14.0
- Yarn v4.5.0
I’m consistently encountering TypeScript compilation errors, primarily related to the @speckle/server and @speckle/viewer packages. Notably, other packages like @speckle/tailwind-theme, @speckle/objectloader, @speckle/objectsender, @speckle/preview-frontend, and @speckle/ui-components seem to build successfully.
The errors for server and viewer are:
- Conflicting @types/express definitions (Server):
Errors like
Type 'import("...node_modules/@types/express-session/node_modules/@types/express/index").RequestHandler<...>' is not assignable to type 'import("...node_modules/@types/express/index").RequestHandler<...>'
.
This suggests multiple versions of Express types are being picked up. - AWS SDK type mismatches (Server):
Errors regarding missing properties likeidentifyOnResolve
,Body
, orContentLength
onServiceOutputTypes
, indicating potential conflicts between AWS SDK v2/v3 types. - Apollo Server context type issues (Server):
Errors whereBaseContext
is not assignable toGraphQLContext
, often missing properties likeauth
. - @speckle/viewer tsconfig.json:
TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.
(Though I’ve tried setting both toNodeNext
to align with Node 22)
I’ve already tried:
- Updating packages/server/tsconfig.json and packages/viewer/tsconfig.json to
NodeNext
formodule
andmoduleResolution
. - Adding explicit
resolutions
for@types/express
,@types/express-session
,@types/express-serve-static-core
,@types/passport
, and@aws-sdk/types
in the root package.json. - Performing full
node_modules
andyarn.lock
cleanups followed byyarn install
after each change.
Could you please advise on the recommended approach for these specific type resolution issues in the @speckle/server and @speckle/viewer packages within the monorepo, especially with Node 22 and Yarn 4?
Thanks in advance for any help!