Closed HenrikFricke closed 7 months ago
Hey @HenrikFricke, can you please share your remix.config.js
file?
@jkomyno Sure, some essential files:
remix.config.js:
/** @type {import('@remix-run/dev').AppConfig} */
export default {
ignoredRouteFiles: ["**/*.css"],
server: "./server.ts",
serverBuildPath: "functions/[[path]].js",
serverConditions: ["workerd", "worker", "browser"],
serverDependenciesToBundle: "all",
serverMainFields: ["browser", "module", "main"],
serverMinify: true,
serverModuleFormat: "esm",
serverPlatform: "neutral",
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// publicPath: "/build/",
};
server.ts:
import { logDevReady } from "@remix-run/cloudflare";
import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages";
import * as build from "@remix-run/dev/server-build";
if (process.env.NODE_ENV === "development") {
logDevReady(build);
}
export const onRequest = createPagesFunctionHandler({
build,
getLoadContext: ({ context }) => ({ env: context.cloudflare.env }),
});
tsconfig.json:
{
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2022",
"strict": true,
"allowJs": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
},
"noEmit": true
}
}
@HenrikFricke Remix is now using Vite https://remix.run/docs/en/main/future/vite#getting-started
Awesome, that works! I wasn't aware I need to migrate to Vite. Thanks for your quick help 🙏
Bug description
I tested the new adapter for Neon databases, but I'm not able to start the Remix dev server. The error message:
How to reproduce
npx create-remix@latest --template remix-run/remix/templates/cloudflare-pages
DATABASE_URL
in.dev.vars
npm run dev
and open a route with Prisma clientExpected behavior
The Prisma client works in Remix loader and can connect to the database.
Prisma information
Schema:
Remix route example:
Environment & setup
Prisma Version