StefanTerdell / zod-to-json-schema

Converts Zod schemas to Json schemas
ISC License
894 stars 75 forks source link

Version 3.23.4 - Cannot find module [...] zod-to-json-schema/dist/esm/parsers/branded #151

Closed RSamaium closed 1 hour ago

RSamaium commented 3 hours ago

Hey,

The latest version does not work (3.23.4)

https://stackblitz.com/edit/stackblitz-starters-jhxkjr?file=package.json

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/projects/stackblitz-starters-jhxkjr/node_modules/zod-to-json-schema/dist/esm/parsers/branded' imported from /home/projects/stackblitz-starters-jhxkjr/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
robsongajunior commented 3 hours ago

The Actions that was running broken after the last update 20min ago:

Cannot find module '/Users/robson.junior/dev/site/node_modules/zod-to-json-schema/dist/esm/parsers/branded' imported from /Users/robson.junior/dev/site/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
  Stack trace:
    at finalizeResolution (node:internal/modules/esm/resolve:265:11)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
tobiasgm commented 3 hours ago

Looks like the import statement for branded module in this commit is not correct: https://github.com/StefanTerdell/zod-to-json-schema/commit/ccf1cbf61c415ebb4b8252736979d5632662c208#diff-618e37ffb2ed63e6b03a60dd390c5ce5fb8c6bd8d57572104c5080948c4437f6R12

Missing .js file-extension.

lboyett commented 2 hours ago

@tobiasgm is correct. Add ".js" after "./branded" in the record.js and it works

nnisarggada commented 2 hours ago

Thank you @tobiasgm

StefanTerdell commented 1 hour ago

Sorry about that lads! Should be fixed in 3.23.5