Comments (5)
I can take a look at this
from fastify-autoload.
I have no clue on how to help with this.
from fastify-autoload.
Can you please create a full repo to reproduce? Or possibly send a PR?
from fastify-autoload.
@mcollina here you go https://stackblitz.com/edit/node-flfxgv?file=package.json,.babelrc,tsconfig.json,app.ts,routes%2Findex.ts
from fastify-autoload.
I did some investigations on this and it looks like there was an attempt to support ts files:
#264
But it got reverted because of an issue in js files.
To use typescript files you need to use ts-node. In your example, use the following script:
"scripts": { "start": "ts-node app.ts" },
(you will need to install the missing dependencies).
To use javascript files, you can use babel-node like this:
"scripts": { "start": "babel-node -x \".js\" app.js" },
(in your example, you will need to change the file extensions)
What we can do is trying to use bits of the reverted PR (mentioned above) to make sure the user can use ts-node.
PR for this is here:
#272
from fastify-autoload.
Related Issues (20)
- Add matchPattern to load only some specific paths HOT 2
- dirNameRoutePrefix option doesn't work when set to false HOT 2
- Mock plugins with autoload HOT 2
- Property '<property>' does not exist on type FastifyInstance when loading TS plugin HOT 1
- Two fastify instances, two `indexPattern` that seems been ignored HOT 2
- Autoload cannot read absolute paths from tsconfig throws error - "Error","message":"Cannot find module '@/Model/User/UserVerifyService' HOT 2
- Node 20 auto-loader not able to transpile TS to JS when using ts-node/esm HOT 24
- Params validation HOT 7
- Not able to have top-level await in a ts ESM file? HOT 3
- Fastify Autoload does not work with Bun.js or deno HOT 2
- Allow concatenation of child plugin prefixes when encapsulate is set to false HOT 2
- setNotFoundHandler is not encapsulated when called inside autohooks.js HOT 3
- autoloader breaks node --test --experimental-test-coverage HOT 2
- Cannot use with esm only HOT 1
- ts-node error with plugins using custom instance field via declaration merging HOT 1
- fileNameRoutePrefix HOT 3
- autoConfig dependencies not respected HOT 1
- Typescript, Vitetest, and Autoload HOT 10
- Achieve 100% test coverage HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastify-autoload.