Closed anton-matsyshyn closed 3 years ago
I figured out, that this problem happen only when I start my app with react-app-rewired start
. When I use react-scripts start
everything works good
Usually these problems occur because of the additional build steps that you are injecting using react-app-rewired (e.g. by adding features such as webworkers, using a mix of different versions of babel and jest, additional changes made to the webpack configuration causing issues with plugins, etc).
Without more information on how exactly you used react-app-rewired to make changes to your build process, we can't help identify where the problem lies.
Most of the time (95+%) the problem is in code that belongs to a different project/library/webpack plugin/babel plugin/etc, rather than in react-app-rewired itself. The only way react-app-rewired was involved was that it was permitting you to add that other library to your build, while react-scripts itself didn't give you the freedom to include that library and therefore didn't have the build problem due to the inclusion of that library occur.
@dawnmist thank you for your answer. I rolled back to react-scripts
3.3.0 and my project starts as well. But now I can't override eslint settings. Maybe I'm doing something wrong?
Here is my .eslintrc:
{
"parser": "@typescript-eslint/parser",
"extends": [
"airbnb",
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"@typescript-eslint"
],
"env": {
"browser": true,
"node": true,
"commonjs": true,
"es6": true
},
"rules": {
...
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interaction": "off",
...
},
"ignorePatterns": [
"setupProxy.js",
"config-overrides.js",
"node_modules/"
],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"moduleDirectory": ["node_modules", "src/"]
}
}
}
}
config-overrides.js:
const { override, useEslintRc } = require('customize-cra');
const path = require('path');
module.exports = override(
useEslintRc(path.resolve(__dirname, '.eslintrc'))
);
As you can see, I turned off jsx-a11y/click-events-have-key-events
rule, but I still getting it in the console:
Line 24:7: Visible, non-interactive elements with click handlers must have at least one keyboard listener jsx-a11y/click-events-have-key-events
Are you starting it with react-app-rewired, or with react-scripts still? Config-overrides.js will only be used with react-app-rewired (it's how react-app-rewired modifies react-scripts).
I'm starting my project with react-app-rewired
now
Can you create an example repository that has the same issue, or give me access to your repo, so I can investigate further? At this point, I need to be able to see what is happening and step through the actual process in order to be able to help any further.
When I'm trying to start my application I'm getting this error:
There are the logs:
This command began to fail after I'd updated
react-sripts
to 4.0.1 and set up nextcompilerOptions
in tsconfig.json:I'll be very glad if you give me any advices how to fix this problem, because I don't understand what exactly I did wrong