question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: host.fileExists is not a function. When trying to generate types from swagger schema

See original GitHub issue

I have .sh script Снимок экрана 2022-10-20 в 14 02 47

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:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
js2mecommented, Oct 21, 2022

@antonmazhuto I know about this problem but I fixed that in 10.0.2 version

0reactions
antonmazhutocommented, Oct 31, 2022

@js2me Thank you very much. I solved the problem by updating to the latest version of swagger-typescript-api

Read more comments on GitHub >

github_iconTop Results From Across the Web

'TypeError: hosts.fileExists is not a function' · Issue #4565
This is an error I'm getting in an existing build system moving from TypeScript 1.5.3 to 1.6/1.7 to take advantage of the new...
Read more >
react-test-renderer cause TypeError: host.fileExists is not a ...
I was getting error that react-test-renderer is not found, so I installed it but including it in package.json causes another error.
Read more >
swagger-typescript-api - npm
Generate api via swagger scheme. Supports OA 3.0, 2.0, JSON, yaml. Generated api module use Fetch Api or Axios to make requests.
Read more >
IDEA 14.1.6 - TypeScript compile error "TypeError: host ...
The error states "Error:Error has occurred in the compile process TypeError: host.fileExists is not a function". I believe this error occurs on ...
Read more >
Fix list for IBM App Connect Enterprise Version 11.0
IT40202, X-ORIGINAL-HTTP-COMMAND HEADER DOES NOT INCLUDE HOST AND PORT VALUE IN THE ... USER DEFINED NODE FUNCTION HAVE THE INCORRECT TYPE.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found