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.

baseUrl not set correctly for TypeScript with version 13.8.0.0

See original GitHub issue

We have a project which generates TS code using NSwag and today I updated to version 13.8.0.0, and it seems to have broken how baseUrl is set.

Where it previously, in the constructor, generated:

this.baseUrl = baseUrl ? baseUrl : this.getBaseUrl("");

It now generates:

this.baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");

Notice the value isn’t actually set anywhere.

A quick search/replace to the following, fixed the problem:

this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");

I have made other changes to my code recently, but nothing I can think of would cause this other than upgrading the packages.

I’ll gladly provide more info, if you let me know what you need to know. I was just wondering, if what you were after, was:

this.baseUrl = baseUrl ?? this.getBaseUrl("");

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
fmendez89commented, Sep 29, 2020

Thanks for the quick fix!

1reaction
sebastien-allardcommented, Sep 28, 2020

Sorry, I’m learning TypeScript as I debug… I had a “this.” in the condition. All good. 13.8.1 fixes it. 🙂

Thank you @johnnyreilly for your quick fix! 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript baseUrl with Node.js
So how can I make node.js working with baseUrl or make typescript replacing paths like "hello/foo" to "../../../.
Read more >
baseUrl - TSConfig Option
How this setting affects your build.
Read more >
tsconfig.json for using baseUrl and importing json
I am about to transform an existing nodejs app to typescript. ... src/server.ts", "test": "echo \"Error: no test specified\" && exit 1" } ......
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