We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ideally relative Import path should contain the .js extension in the auto-generated routes.js file.
.js
routes.js
This would avoid an [ERR_MODULE_NOT_FOUND] errors in context not allowing extensionless module reference.
[ERR_MODULE_NOT_FOUND]
I'm submitting a ...
I confirm that I
Generated code fail to run in some restricted context.
Auto-generated routes.js is always able to load imported modules
Run a post generation script to add missing .js extension. For instance, https://www.npmjs.com/package/fix-tsc-es-imports.
Add .js in import { {{name}} } from '{{modulePath}}.js'; templates -
import { {{name}} } from '{{modulePath}}.js';
I can propose a PR i that make sense
The text was updated successfully, but these errors were encountered:
Hello there christophe-g 👋
Thank you for opening your very first issue in this project.
We will try to get back to you as soon as we can.👀
Sorry, something went wrong.
Hello,
By reading the configuration file documentation: https://github.com/lukeautry/tsoa/blob/master/packages/runtime/src/config.ts
I found that you can set
// tsoa.json "routes": { "esm": true }
The .js will be added automatically in the routes.ts file.
routes.ts
Oh - merci beaucoup @mhammerc !
Don't know how I missed that.
Closing as resolved
No branches or pull requests
Ideally relative Import path should contain the
.js
extension in the auto-generatedroutes.js
file.This would avoid an
[ERR_MODULE_NOT_FOUND]
errors in context not allowing extensionless module reference.Sorting
I'm submitting a ...
I confirm that I
Current Behavior
Generated code fail to run in some restricted context.
Expected Behavior
Auto-generated
routes.js
is always able to load imported modulesPossible Solution
Run a post generation script to add missing
.js
extension. For instance, https://www.npmjs.com/package/fix-tsc-es-imports.Add
.js
inimport { {{name}} } from '{{modulePath}}.js';
templates -I can propose a PR i that make sense
The text was updated successfully, but these errors were encountered: