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.

compatibility with esbuild

See original GitHub issue

When importing stuff like Route, Body, etc from tsoa, bundling code with esbuild fails and tries to use tsoa as the cli.

Sorting

  • bug report

  • feature request

  • support request

  • I confirm that I

    • used the search to make sure that a similar issue hasn’t already been submit

Steps to Reproduce

  • install esbuild and tsoa
  • copy the tsoa example from the docs
  • bundle it with esbuild src/server.ts target=node --outfile=index.js
  • try running it with node index.js
  • instead of starting the server as expected, the bundled code is treated as if it were the command line tsoa function.

This can be solved by importing from @tsoa/runtime directly.

Version of the library: "tsoa": "^3.9.0" Version of NodeJS: v14.17.0

  • Confirm you were using yarn not npm: [x]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
jpmtrabboldcommented, Oct 10, 2021

@WoH great! PR done, tests passed. The PR is minimal, but let me know if you have any problems with it. Thanks

0reactions
jpmtrabboldcommented, Oct 18, 2021

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Content Types - ESBuild
This is very unfortunate because it causes endless compatibility headaches, especially since JavaScript libraries are often authored in ESM and published as ...
Read more >
FAQ - ESBuild
Patch versions are intended for backwards-compatible changes and minor versions are intended for backwards-incompatible changes. If you plan to use esbuild ...
Read more >
Getting Started - ESBuild
Getting Started. #Install esbuild. First, download and install the esbuild command locally. A prebuilt native executable can be installed using npm (which ...
Read more >
API - esbuild
Bundling with esbuild only works with statically-defined imports (i.e. when the ... This behavior improves compatibility with CommonJS modules that export a ...
Read more >
Plugins - esbuild
If you want to resolve a path relative to the directory containing the importer module, you should use resolveDir instead since that also...
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