-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
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
How does it work with @fastify/autoload ? #7
Comments
It works as usual, like described here https://github.com/fastify/fastify-autoload // src/app.ts
import autoLoad from '@fastify/autoload'
import { dirname, join } from 'path'
import { fileURLToPath } from 'url'
export default async (opts?: FastifyServerOptions) => {
const fastify = Fastify(opts)
fastify.register(autoLoad, {
dir: join(__dirname, 'plugins')
})
... |
just found that the @fastify/autoload can not utilize the vite-plugin-node, it's reported here fastify/fastify-autoload#230 and here is my test result: ❯ npm run dev
vite v2.9.9 dev server running at:
ready in 270ms. /home/ian/templates/fastify/node_modules/.pnpm/@fastify[email protected]/node_modules/@fastify/autoload/index.js:222 Error: @fastify/autoload cannot import plugin at '/home/ian/templates/fastify/src/routes/root.ts'. To fix this error compile TypeScript to JavaScript or use 'ts-node' to run your app. Node.js v18.2.0 |
Thanks for your feedback. I'll take a look... |
Also for me, same issue. |
Similar issue in vitest that has a solution fastify/fastify-autoload#230 (comment) I have no idea if there's a similar solution for vite-plugin-node |
Thanks for the link. I will take a try... |
Very cool boilerplate, but I got lost when trying to add @fastify/autoload...
The text was updated successfully, but these errors were encountered: