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.

[BUG] typescript-fetch code does not compile because of Errors

See original GitHub issue

Bug Report Checklist

  • ALL Specs Have you provided a full/minimal spec to reproduce the issue?
  • All Specs Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What’s the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

typescript-fetch code does not compile because of Errors

openapi-generator version
"@openapitools/openapi-generator-cli": "^1.0.18-4.3.1",

and “@openapitools/openapi-generator-cli”: “^1.0.18-5.0.0-beta2”,

"typescript": "^4.2.3",
OpenAPI declaration file content or url

any file

Generation Details

There are many bugs like

Error TS6133: 'InlineResponse2003ToJSON' is declared but its value is never read.
Steps to reproduce
openapi-generator generate -i openapi.yaml -g typescript-fetch -o ui/src/generated
tsc ui/src/generated/runtime.ts
Related issues/PRs
Suggest a fix

replace /* tslint:disable */ by // @ts-nocheck or add extra ts-nocheck line

diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache
index 8466deb2853..3781155fd63 100644
--- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache
+++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache
@@ -1,3 +1,4 @@
+// @ts-nocheck
 /* tslint:disable */
 /* eslint-disable */
 {{>licenseInfo}}
diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/models.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/models.mustache
index 20135a84425..e8c7db348c3 100644
--- a/modules/openapi-generator/src/main/resources/typescript-fetch/models.mustache
+++ b/modules/openapi-generator/src/main/resources/typescript-fetch/models.mustache
@@ -1,3 +1,4 @@
+// @ts-nocheck
 /* tslint:disable */
 /* eslint-disable */
 {{>licenseInfo}}
diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache
index d0c29b93a75..ff219a869e5 100644
--- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache
+++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache
@@ -1,3 +1,4 @@
+// @ts-nocheck
 /* tslint:disable */
 /* eslint-disable */
 {{>licenseInfo}}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
sdoeringNewcommented, Apr 26, 2022

bump

Time to merge? It’s the same solution like typescript-axios already has. So it can’t be bad for typescript-axios.

2reactions
Krawartcommented, Mar 7, 2022

Do you plan to merge this solution soon?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript errors and how to fix them
Common Errors​​ Below you find a list of common TypeScript errors along with the buggy code and its fixed version.
Read more >
Error: TSError: Unable to compile TypeScript - Stack Overflow
I came here looking for a solution for a similar error when I updated my typescript version, Mine was not a new project,...
Read more >
Error Messages | Cypress Documentation
This message means that Cypress encountered an error when compiling and/or bundling your test file. Cypress automatically compiles and bundles your test code...
Read more >
Documentation - TypeScript 3.8
Is only 'Foo' a type? Or every declaration in the import? // We just give an error because it's not clear. import type...
Read more >
Handling common JavaScript problems - MDN Web Docs
html example (see the source code also). If you look at the console, you'll see the error message "Uncaught TypeError: can't access property...
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