nuxt / nuxt/content

`bun install` always fails because of a dependency check bug

Open
#3,547 14 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.7k
Forks
746
Avg merge
1d 16h
Merged PRs (30d)
3

Description

Environment
  • Operating System: Darwin
  • Node Version: v20.9.0
  • Nuxt Version: 4.1.2
  • CLI Version: 3.28.0
  • Nitro Version: 2.12.6
  • Package Manager: bun@1.2.22
  • Builder: -
  • User Config: modules, compatibilityDate, devtools, content
  • Runtime Modules: @nuxt/content@3.7.1
  • Build Modules: -
Version

v3.7.1

Reproduction

https://github.com/dannote/nuxt-content-reproduction

Description

The installation fails although zod is in my package.json:

$ bun install                                                                                                                           

bun install v1.2.22 (6bafe260)

$ nuxt prepare

 ERROR  It seems you are using Zod version 4 for collection schema, but Zod is not installed, Nuxt Content does not ship with zod, install zod and it will work.  12:04:38 AM

    at Object.toJSONSchema (node_modules/@nuxt/content/dist/module.mjs:198:13)
    at defineCollection (node_modules/@nuxt/content/dist/module.mjs:2283:32)
    at content.config.ts:7:44
    at async Function.import (node_modules/jiti/dist/jiti.cjs:1:202945)
    at async resolveConfig (node_modules/c12/dist/shared/c12.Bzgyhsy6.mjs:382:18)
    at async loadConfig (node_modules/c12/dist/shared/c12.Bzgyhsy6.mjs:169:23)
    at async Promise.all (index 0)
    at async loadContentConfig (node_modules/@nuxt/content/dist/module.mjs:2487:26)
    at async setup (node_modules/@nuxt/content/dist/module.mjs:2866:29)
    at async normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:199:17)



 ERROR  It seems you are using Zod version 4 for collection schema, but Zod is not installed, Nuxt Content does not ship with zod, install zod and it will work.
Additional context

No response

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and run bun install to confirm the failure. Inspect content.config.ts and the dependency-check path shown in node_modules/@nuxt/content/dist/module.mjs, especially the toJSONSchema and defineCollection entries in the stack trace. Done means the reproduction installs successfully with zod declared in package.json.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, nuxt, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.