What to do about Date not serializable when calling getServerSideProps?
https://clips.twitch.tv/DrabPatientKathyArsonNoSexy-O_B1C2XYw_9SFEg2
Do I have to use multiple types or is there a way around this?
Twitch
Theo - InferGetServerSideProps says it has a date object, I can tru...
Watch Theo's clip titled "InferGetServerSideProps says it has a date object, I can trust it ....right??"
Solution:Jump to solution
/**
* Run
build or
dev with
SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.mjs");...3 Replies
Found the solution, use withsuperjson
Solution
/**
* Run
build or
dev with
SKIP_ENV_VALIDATION to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.mjs");
import { withSuperjson } from "next-superjson";
/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,
/**
* If you are using
appDir then you must comment the below
i18n config out.
*
* @see https://github.com/vercel/next.js/issues/41980
*/
i18n: {
locales: ["en"],
defaultLocale: "en",
},
};
export default withSuperjson()(config);
Here's my next.config.mjs