S
SolidJS10mo ago
sh1man

TRPC. The module system cannot find the file

Help pls. The module system cannot find the file ~/server/routers/root imported into E:/Coding/Projects/tv_emr_log/frontend/src/routes/api/trpc/[trpc].ts. this file root.ts:
import { authRouter } from './auth';
import { router} from "~/server/trpc";


export const appRouter = router({
auth: authRouter
});
export type AppRouter = typeof appRouter;
import { authRouter } from './auth';
import { router} from "~/server/trpc";


export const appRouter = router({
auth: authRouter
});
export type AppRouter = typeof appRouter;
this file [trpc].ts
import { type APIEvent } from "@solidjs/start/server";
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
import {appRouter} from "~/server/routers/root";

const handler = (event: APIEvent) =>
fetchRequestHandler({
endpoint: "/api/trpc",
req: event.request,
router: appRouter,
createContext: () => ({})
});
export const GET = handler;
export const POST = handler;
import { type APIEvent } from "@solidjs/start/server";
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
import {appRouter} from "~/server/routers/root";

const handler = (event: APIEvent) =>
fetchRequestHandler({
endpoint: "/api/trpc",
req: event.request,
router: appRouter,
createContext: () => ({})
});
export const GET = handler;
export const POST = handler;
tsconfig.json
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"allowJs": true,
"strict": true,
"noEmit": true,
"types": ["vinxi/client"],
"isolatedModules": true,
"paths": {
"~/*": ["./src/*"]
}
}
}
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"allowJs": true,
"strict": true,
"noEmit": true,
"types": ["vinxi/client"],
"isolatedModules": true,
"paths": {
"~/*": ["./src/*"]
}
}
}
2 Replies
Jasmin
Jasmin10mo ago
@sh1man I think you're missing "baseUrl": "." in your tsconfig compilerOptions.
sh1man
sh1manOP10mo ago
I'll try today
Want results from more Discord servers?
Add your server