Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error Caused by Zod Dependency Issues #3300

Closed
lincheoll opened this issue Feb 6, 2025 · 3 comments
Closed

Build Error Caused by Zod Dependency Issues #3300

lincheoll opened this issue Feb 6, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@lincheoll
Copy link
Contributor

Describe the bug

An error occurs during the build process, preventing it from completing successfully.

To Reproduce

node version 23.3.0

  1. Run the build based on the commit 2eb94ab merged into the main branch.
  2. Execute the following commands in order:
    • pnpm clean
    • pnpm install --no-frozen-lockfile
    • pnpm build
  3. The error occurs during the build process.

Expected behavior

The build should complete successfully without any errors.

Screenshots

Additional context

DTS Build start
@elizaos/client-direct:build: src/index.ts(510,21): error TS2322: Type 'ZodObject<{ lookAt: ZodNullable<ZodLiteral<string>> | ZodNullable<ZodUnion<[ZodLiteral<string>, ZodLiteral<string>, ...ZodLiteral<string>[]]>> | ZodNull; emote: ZodNullable<...> | ... 1 more ... | ZodNull; say: ZodNullable<...>; actions: ZodNullable<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>' is not assignable to type 'ZodType<any, ZodTypeDef, any>'.
@elizaos/client-direct:build:   The types of '_getOrReturnCtx(...).common.issues' are incompatible between these types.
@elizaos/client-direct:build:     Type 'Zod.ZodIssue[]' is not assignable to type 'import("/Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/zod/lib/ZodError").ZodIssue[]'.
@elizaos/client-direct:build:       Type 'Zod.ZodIssue' is not assignable to type 'import("/Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/zod/lib/ZodError").ZodIssue'.
@elizaos/client-direct:build:         Type 'ZodInvalidUnionIssue & { fatal?: boolean; message: string; }' is not assignable to type 'ZodIssue'.
@elizaos/client-direct:build:           Type 'Zod.ZodInvalidUnionIssue & { fatal?: boolean; message: string; }' is not assignable to type 'import("/Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/zod/lib/ZodError").ZodInvalidUnionIssue & { fatal?: boolean; message: string; }'.
@elizaos/client-direct:build:             Type 'ZodInvalidUnionIssue & { fatal?: boolean; message: string; }' is not assignable to type 'ZodInvalidUnionIssue'.
@elizaos/client-direct:build:               Types of property 'unionErrors' are incompatible.
@elizaos/client-direct:build:                 Type 'Zod.ZodError<any>[]' is not assignable to type 'import("/Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/zod/lib/ZodError").ZodError<any>[]'.
@elizaos/client-direct:build:                   Type 'Zod.ZodError<any>' is not assignable to type 'import("/Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/zod/lib/ZodError").ZodError<any>'.
@elizaos/client-direct:build:                     Types of property 'issues' are incompatible.
@elizaos/client-direct:build:                       Type 'Zod.ZodIssue[]' is not assignable to type 'import("/Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/zod/lib/ZodError").ZodIssue[]'.
@elizaos/client-direct:build:                         Type 'Zod.ZodIssue' is not assignable to type 'import("/Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/zod/lib/ZodError").ZodIssue'.
@elizaos/client-direct:build:                           Type 'ZodInvalidUnionIssue & { fatal?: boolean; message: string; }' is not assignable to type 'ZodIssue'.
@elizaos/client-direct:build: 
@elizaos/client-direct:build: Error: error occurred in dts build
@elizaos/client-direct:build:     at Worker.<anonymous> (/Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/tsup/dist/index.js:1541:26)
@elizaos/client-direct:build:     at Worker.emit (node:events:513:28)
@elizaos/client-direct:build:     at MessagePort.<anonymous> (node:internal/worker:267:53)
@elizaos/client-direct:build:     at [nodejs.internal.kHybridDispatch] (node:internal/event_target:827:20)
@elizaos/client-direct:build:     at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
@elizaos/client-direct:build: DTS Build error
@elizaos/client-direct:build:  ELIFECYCLE  Command failed with exit code 1.
@elizaos/client-direct:build: ERROR: command finished with error: command (/Users/incheolkang/Desktop/study/ai16z/eliza/packages/client-direct) /Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/.bin/pnpm run build exited (1)
@elizaos/client-direct#build: command (/Users/incheolkang/Desktop/study/ai16z/eliza/packages/client-direct) /Users/incheolkang/Desktop/study/ai16z/eliza/node_modules/.bin/pnpm run build exited (1)

 Tasks:    148 successful, 149 total
Cached:    148 cached, 149 total
  Time:    5.525s 
Failed:    @elizaos/client-direct#build

 ERROR  run failed: command  exited (1)
 ELIFECYCLE  Command failed with exit code 1.
@lincheoll lincheoll added the bug Something isn't working label Feb 6, 2025
@michaelgreen06
Copy link

This is SOOOO annoying!! I just spent SOO many hours trying to track down the same issue!

My conclusion: pnpm's dependency resolution gets wonky after cleanup - the hoisting and linking gets messed up.

The (janky) solution I found: add: "resolutions": { "zod": "^3.22.0" }. to your package.json. That should force consistent versions.

I think we really need to figure out how to address this issue because it causes such horrible devx if someone isn't aware of what's happening. The only other solution I have found is to nuke the entire directory and re-clone it.

@MehmoodSheikh
Copy link

Encounter same issue, Could you able to solve this issue?

@lincheoll
Copy link
Contributor Author

@MehmoodSheikh

Sorry, I just saw this as I was busy.

The tagged version didn’t have any issues, so I was working with that.
I didn’t specifically work on fixing this issue.

I checked today, and it doesn’t seem to occur anymore.
So I’ll go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants