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.

Can't generate code with ranged Typescript version

See original GitHub issue

What are the steps to reproduce this issue?

  1. Set the Typescript version to "typescript": ">=4.3.4 <5.0.0" from package.json
  2. Run the code generation.

What happens?

It will throw an error Oups... 🍻. An Error occurred while splitting => Error: Invalid argument not valid semver ('>=4.3.4 <5.0.0' received)

What were you expecting to happen?

The code should be generated

Any logs, error output, etc?

Oups... 🍻. An Error occurred while splitting => Error: Invalid argument not valid semver ('>=4.3.4 <5.0.0' received)

Any other comments?

  • As far as I observed, this error was came from src/core/writers/target.ts and compare function in compare-versions
  • How about adding the typescriptVersion property to orval config to explicitly specify the typescript version? Right now, it depends on the generator package’s typescript version, but in my use case, I have two separate projects. The first one is generated code project, and the other is using that codes, which means they could be different typescript versions.
  • My workaround is here

What versions are you using?

**Operating System: macOS Monterey 12.1 **Package Version: 6.7.1 **Browser Version: x

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, Sep 23, 2022

As always you are the best!

1reaction
anymaniaxcommented, Sep 23, 2022

@melloware fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install older version of Typescript?
For installing typescript 1.7.5, use npm install typescript@1.7.5.
Read more >
TypeScript Compiling with Visual Studio Code
No, the TypeScript language service that ships with Visual Studio 2019 and 2022 isn't compatible with VS Code. You will need to install...
Read more >
Can typescript please follow semver? So ...
Typescript versions aren't like other node package versions. Now sure how they increment and who decides version numbers.
Read more >
Documentation - TypeScript 3.9
Visual Studio Code supports selecting different versions of TypeScript. Alternatively, there's the JavaScript/TypeScript Nightly Extension to stay on the ...
Read more >
TypeScript | IntelliJ IDEA Documentation
Make sure the JavaScript and TypeScript plugin is enabled in the settings. Press Ctrl+Alt+S to open the IDE settings and select Plugins. Click ......
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