Failed to load 'react-hooks'
Failed to format React files
I'm using VSCode - insiders and Remote - SSH to develop on a remote machine. When using create-react-app, Prettiers fails to format the files and gives an error.
Steps To Reproduce:
- Create React app with
npx create-react-app app - Configure ESLint and Prettier extensions in VSCode
- Save file
Expected result
Formatted file.
Actual result
Error by Prettier:
8/16/2019, 9:45:43 AM:
----------------------
Failed to load plugin 'react-hooks' declared in 'CLIOptions'/home/shaunjanssens/projects/gotoo/webapp/src/App.js:: Cannot find module 'eslint-plugin-react-hooks'
Require stack:
- /home/shaunjanssens/__placeholder__.js
Additional information
VS Code Version: 1.38.0-insider
Prettier & Prettier Plugin Version: 1.18.2 (installed on server) / 1.9.0
OS and version: Mac OS and Ubuntu 18.04 (remote development)
React-scripts: 3.1.1
settings.json
{
"eslint.validate": [
{
"language": "vue",
"autoFix": true
},
{
"language": "html",
"autoFix": true
},
{
"language": "javascript",
"autoFix": true
},
{
"language": "react",
"autoFix": true
}
],
"eslint.autoFixOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": false,
"prettier.eslintIntegration": true,
"prettier.singleQuote": true,
"prettier.semi": false
}
I already tried to install eslint-plugin-react-hooks both as a dev dependency and global on server.
same problem
- windows 10
- create-react-app v3.1.1
- vscode version 1.37.1
same here
- macOS Mojave 10.14.5
- vscode 1.36.1
- prettier-vscode 1.9.0
- CRA 3.1.1
I guess the problem lies on the eslint version 6.x, it's incompatible with the current version of prettier-vscode.
same problem here
Also experiencing this issue
- windows 10
- create-react-app 3.0.1
- vscode 1.37.1
- prettier 1.9.0
Same problem here
also experiencing this problem:
- macOS Mojave 10.14.6
- vscode 1.37.1
- prettier 1.9.0
Same problem here
- windows 10 64bit
- vscode 1.37.1
- prettier1.9.0
- CRA 3.1.1
Same problem here
windows 10 64bit vscode 1.37.1 CRA 3.1.0
Must be a vscode issue
Same as @cemujax here
- windows 10 64bit
- vscode 1.37.1
- prettier1.9.0
- CRA 3.1.1
same problem
windows 10 create-react-app v3.1.1 vscode version 1.37.1
prettier 1.9.0 vscode 1.37.1 eslint-plugin-vue and eslint last version
I get Similar problem i got the error of 'Failed to load plugin 'vue' declared in........cant get module eslint-plugin-vue' but i already install it both as a dev dependency and global dependency.
https://github.com/facebook/react/issues/16531#issuecomment-523620795
rm -rf node_modules && npm i and then restart vscode fixed it for me.
@tylergraf I do like you talk but I can't fix this issue
Yep facing same issue
same
I was able to correct this issue by deleting eslint-config-react-app from node_modules and reinstalling the newest version via npm i --save-dev eslint-config-react-app.
OS: Windows 10 CRA: v3.1.1 VSCode: v1.37.1
I resolve this problem use "prettier.eslintIntegration": false in my VSCode config
Thanks, @izayl. I fixed this issue like you
RIP productivity and sanity at work this week. Hope someone finds a proper fix