Firstly, there are some questions on SO with similar titles but I don't believe this is a duplicate as I thin it's a recent change to a package or vercel causing it.
I upgraded some packages in an app I'm building today..
Here are the packages which changed
"dependencies": {
"next": "^13.2.3",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "18.14.2",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"eslint": "8.35.0",
"eslint-config-next": "^13.2.3",
"typescript": "4.9.5"
}
Since then I am getting lots of new linting errors when trying to deploy the same code to Vercel which was deploying fine yesterday. Here is an example
Type error: 'supplierId' is possibly 'undefined'.
56 |
57 | // Get Supplier Products
> 58 | const supplierProductsQuery = trpc.supplierProducts.get.useQuery({supplier_id: supplierId}, { enabled: supplierId > 0, ...refetchNever });
This code looks fine to me. I know the variable might be undefined and that's why I'm using it as a flag to enable something when it's not. Anyway, that's an aside. The point is that I don't get any errors like this running locally, running next dev, next lint and next build all run with no errors, but on Vercel it seems to be much stricter all of a sudden, or be running totally different linting rules.
Can anybody explain why this might be?