TypeError: host.fileExists is not a function. When trying to generate types from swagger schema
See original GitHub issueI have .sh script
Then I tying to run "api:update": "scripts/api.update.sh"
from my package.json
But getting such problem:
/Users/antonmazuto/.nvm/versions/node/v16.16.0/bin/node /Users/antonmazuto/.yarn/bin/yarn.js run api:update yarn run v1.22.19 warning …/…/…/…/…/package.json: No license field $ scripts/api.update.sh ✨ try to get swagger by URL “http://localhost:4000/api-json” ✨ try to read templates from directory “/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/templates/default” ☄️ start generating your typescript api TypeError: host.fileExists is not a function at Object.fileExists (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:167620:63) at Object.host.fileExists (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:117500:47) at getPackageJsonInfo (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:44461:37) at loadModuleFromSpecificNodeModulesDirectory (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:45001:27) at loadModuleFromImmediateNodeModulesDirectory (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:44982:58) at /Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:44972:39 at Object.forEachAncestorDirectory (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:8370:26) at loadModuleFromNearestNodeModulesDirectoryWorker (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:44966:19) at loadModuleFromNearestNodeModulesDirectory (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:44958:16) at tryResolve (/Users/antonmazuto/Documents/my/my-apps/chat/chat-frontend-vite/node_modules/swagger-typescript-api/node_modules/typescript/lib/typescript.js:44053:34) src/types/api.ts 235ms ✨ Done in 5.46s.
Process finished with exit code 0
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (3 by maintainers)
@antonmazhuto I know about this problem but I fixed that in 10.0.2 version
@js2me Thank you very much. I solved the problem by updating to the latest version of swagger-typescript-api