withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.82k stars 2.49k forks source link

Cannot find module `.../zod-to-json-schema/...` #12296

Closed Rushmore75 closed 3 weeks ago

Rushmore75 commented 3 weeks ago

Astro Info

npm run astro info

> ad-channels@0.0.1 astro
> astro info

Cannot find module '/home/bob/code/ad-channels/node_modules/zod-to-json-schema/dist/esm/parsers/branded' imported from /home/bob/code/ad-channels/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
  Stack trace:
    at finalizeResolution (node:internal/modules/esm/resolve:264:11)
    at defaultResolve (node:internal/modules/esm/resolve:1148:11)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)

If this issue only occurs in one browser, which browser is a problem?

n/a

Describe the Bug

Running (most) npm run astro ... commands fail with the above output; npm run astro dev npm run astro build. npm run astro outputs fine. Here's version of everything: Product Version
astro v4.16.7
node v21.7.3
@astrojs/check 0.9.4
typescript 5.6.3

What's the expected result?

Default cli operation

Link to Minimal Reproducible Example

doesn't break in their environment

Participation

nnisarggada commented 3 weeks ago

Same issue

delucis commented 3 weeks ago

Just hit this with pnpm too locally. Pretty sure it’s a buggy latest release of zod-to-json-schema: https://github.com/StefanTerdell/zod-to-json-schema/issues/151

Rushmore75 commented 3 weeks ago

Looks like it will be solved in this pull https://github.com/StefanTerdell/zod-to-json-schema/pull/152

OctupusPrime commented 3 weeks ago

Fix mine with pnpm overrides

  "pnpm": {
    "overrides": {
      "zod-to-json-schema": "3.23.3"
    }
  }
StefanTerdell commented 3 weeks ago

Woops! Should be fixed in 3.23.5.

delucis commented 3 weeks ago

Thanks for the quick fix @StefanTerdell!