The following is the code my entry points to:
import type { FastifyCookieOptions } from '@fastify/cookie';
import type { DefineFastifyRoutes } from '@matthewp/astro-fastify';
import { fastifyTRPCPlugin } from '@trpc/server/adapters/fastify';
import { createApiContext } from './api-context.js' // fails;
import { env } from './env.js'; // fails
import { apiRouter } from './routes/index.js'; // fails
const defineRoutes: DefineFastifyRoutes = async (fastify) => {
const cookieOption: FastifyCookieOptions = {
secret: env.JWT_SECRET,
}
fastify
.register(import('fastify-graceful-shutdown'))
.register(import('@fastify/websocket'))
.register(import('@fastify/cookie'), cookieOption)
.register(import('@fastify/csrf-protection'))
.register(fastifyTRPCPlugin, {
prefix: '/trpc',
useWSS: true,
trpcOptions: { router: apiRouter, createContext: createApiContext },
})
};
export default defineRoutes;
All the local imports fail with:
Failed to load url ./api-context.ts (resolved id: ./api-context.ts). Does the file exist?
Do you know what's happening?
The following is the code my entry points to:
All the local imports fail with:
Do you know what's happening?