unsafe assignment of an `any` value

I am needing to pull in a value from my package.json file (the version of the application) and with t3 I am thrown the following error (see screenshot). This is being thrown in my next.config.js file which has the following code:

/**
 * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
 * for Docker builds.
 */
await import("./src/env.js");
import { readFile } from "fs/promises";

const packageJson = JSON.parse(
  await readFile(new URL("./package.json", import.meta.url), "utf-8")
);

/** @type {import("next").NextConfig} */
const config = {
    reactStrictMode: true,
    publicRuntimeConfig: {
        version: packageJson.version,
    },
};

export default config;


I have the red squiggly lines for the entire const packageJson variable assignment and down on the config where version: packageJson.version is. How do I resolve this typing error?
image.png
Solution
yeah, i can. need to commit the changes
Was this page helpful?