@nachocodoner Thanks for coming back to this. In the end it turned out that the culprit was my second commit to the project ever. Here’s what I did:
- Installed the Meteor 3.0.3 React Typescript scaffold using the CLI (first commit)
- Then added ESLint in this second commit
This lead to this package.json:
{
"name": "meteor-app",
"private": true,
"scripts": {
"start": "meteor run",
"test": "meteor test --once --driver-package meteortesting:mocha",
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
"visualize": "meteor --production --extra-packages bundle-visualizer",
"lint": "eslint .",
"pretest": "npm run lint --silent"
},
"dependencies": {
"@babel/runtime": "^7.20.7",
"meteor-node-stubs": "^1.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@meteorjs/eslint-config-meteor": "^1.0.5",
"@types/mocha": "^8.2.3",
"@types/node": "^18.13.0",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"babel-eslint": "^10.1.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-react": "^1.1.7",
"eslint-config-standard": "^12.0.0",
"eslint-config-standard-react": "^7.0.2",
"eslint-import-resolver-meteor": "^0.4.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-meteor": "^5.1.0",
"eslint-plugin-mocha": "^10.5.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-standard": "^4.0.0"
},
"meteor": {
"mainModule": {
"client": "client/main.tsx",
"server": "server/main.ts"
},
"testModule": "tests/main.ts"
}
}
I don’t why, but the usual “typescript” dev dependency in the scaffold vanished here, I can’t remember that I had removed this intentionally.
Important to mention here is that when doing this step, I must have inadvertedly used regular npm i
instead of meteor npm i
. This caused the package-lock.json file version to be downgraded from 3 to 1, as I can see in my commits.
This went unnoticed, and the setup worked just fine on my local machine, I added more and more npm packages, without any complaints by npm. Until several months later, when I updated Meteor to 3.0.4. Suddenly, I got the message that Node was upgrading the package-lock.json file (again).
And this lead into a kind of deadlock, because all of the sudden, npm realized that I had introduced peer dependencies that could not be resolved. After hours of analyzing the root cause, I found out that the culprit was this combination:
"react": "^18.2.0",
"react-dom": "^18.2.0",
"eslint-plugin-react-hooks": "^5.0.0",
which lead to lots of follow-up errors.
I managed to resolve this by downgrading to
"react": "^17.0.2",
"react-dom": "^17.0.2",
"eslint-plugin-react-hooks": "^4.6.2",
After changing these dependencies (and adjusting my code to the older react-dom), I was able to meteor npm i
again.
My lessons learned: Always try to keep an eye on not using npm i
by any means. I wasn’t aware that hits can have to drastic consequences that stay unnoticed for months.
Hope this helps you to assess the situation.
(Not sure if I should re-add the typescript package.)