Closed twnaing closed 1 year ago
@twnaing I think you hit a momentary bug in the npm ecosystem. Details here: https://github.com/eslint/eslint/issues/17317
Sounds like if you upgrade your packages (yarn upgrade
, then yarn install
), that should fix it.
Let me know if you have any other issues with this.
The issue is that the error occurred during the rails new
. So the yarn upgrade
and yarn install
finished successfully, the new project still not at correct state (i.e. yarn start
says error command "start" not found
).
Should I also specify minimal yarn version? I use asdf to fix my versions.
@twnaing I think you will need to delete the generated app directory and then start over by running rails new
again. Does that work?
These are the steps I took
$ rails new . \
-d postgresql \
-m https://raw.githubusercontent.com/mattbrictson/rails-template/main/template.rb
@twnaing sorry you are running into these problems. It seems like the last couple weeks have been a perfect storm of dependency conflicts in the ESlint ecosystem.
You didn't post the latest error message that you are seeing, so I can only take a guess. But based on what I am seeing, I suspect you are hitting this error:
Oops! Something went wrong! :(
ESLint: 8.44.0
TypeError: prettier.resolveConfig.sync is not a function
Occurred while linting app/javascript/application.js:2
Rule: "prettier/prettier"
This is due to the fact that Prettier 3.0 was just released a few days ago, and is causing the eslint-plugin-prettier package to break. You can see the discussion here: https://github.com/prettier/eslint-plugin-prettier/issues/562 .
The rails-template project is susceptible to these breakages because when you run rails new
, the newest versions of its dependencies are fetched. In this case this included Prettier 3.0.
Hopefully eslint-plugin-prettier will release a new version that is compatible with Prettier 3.0. In the meantime I will adjust rails-template to use an alpha version of eslint-plugin-prettier that should work around the problem. See PR #47.
If I guessed incorrectly and TypeError: prettier.resolveConfig.sync is not a function
is not the error you are seeing, please post the details of the error so that I can help you troubleshoot.
I am having the problem with following messages
I have nodes
20.2.0
, yarn1.22.10
and the package.json has this.