Props must be serializable for components in the "use client" entry file. not showing in next lint
Unanswered
Whiteleg shrimp posted this in #help-forum
Whiteleg shrimpOP
I'm getting Props must be serializable for components in the "use client" entry file. in a lot of places, I know how to fix it, that's is not the issue.
The issue is that when I run "next lint" or "eslint ." it doesn't show to error so I can't find all the affected files.
The issue is that when I run "next lint" or "eslint ." it doesn't show to error so I can't find all the affected files.
4 Replies
Whiteleg shrimpOP
This is the config:
import pluginNext from "@next/eslint-plugin-next"
import pluginReact from "eslint-plugin-react"
import pluginReactHooks from "eslint-plugin-react-hooks"
import reactRefresh from "eslint-plugin-react-refresh"
import globals from "globals"
import { config as baseConfig } from "./base.js"
/**
* A custom ESLint configuration for libraries that use Next.js.
*
* @type {import("eslint").Linter.Config}
* */
export const nextJsConfig = [
...baseConfig,
{
...pluginReact.configs.flat.recommended,
languageOptions: {
...pluginReact.configs.flat.recommended.languageOptions,
globals: {
...globals.serviceworker,
},
},
},
{
plugins: {
"@next/next": pluginNext,
"react-refresh": reactRefresh,
},
rules: {
...pluginNext.configs.recommended.rules,
...pluginNext.configs["core-web-vitals"].rules,
},
},
{
plugins: {
"react-hooks": pluginReactHooks,
},
settings: { react: { version: "detect" } },
rules: {
...pluginReactHooks.configs.recommended.rules,
// React scope no longer necessary with new JSX transform.
"react/react-in-jsx-scope": "off",
},
},
]
Chub mackerel
That error comes from Next.js runtime checks in client components, not ESLint. next lint/ESLint won’t catch it because it’s a runtime Next.js validation, not a linting rule. You can only really detect affected files by running the app in dev and checking the console, or by using TypeScript types/utility functions to enforce serializable props.
@Chub mackerel That error comes from Next.js runtime checks in client components, not ESLint. next lint/ESLint won’t catch it because it’s a runtime Next.js validation, not a linting rule. You can only really detect affected files by running the app in dev and checking the console, or by using TypeScript types/utility functions to enforce serializable props.
Whiteleg shrimpOP
I'm actually getting those errors in the VsCode Problems tab, without even running the application or saving the file
@Whiteleg shrimp I'm actually getting those errors in the VsCode Problems tab, without even running the application or saving the file
Chub mackerel
VSCode can show these because TypeScript detects potential runtime issues early