I am stuck with whit compile-time error:
Failed to compile.
./node_modules/@restart/context/forwardRef.js
Module not found: Can't resolve 'react' in 'C:\IdeaProjects\ai\node_modules\@restart\context'
The app has stopped to work suddenly, removing existing changes from last working iteration didn't help. Folder "../node_modules/@restart/context" is in place and is not empty. I tried to deleting package-lock.json and reinstalling, removing all modules and reinstalling, the error persisted.
How can I solve the situation?
App.js:
import React from 'react';
import './App.css';
import {Trans, withTranslation} from 'react-i18next'
import {Header} from "./components/Header";
import {C2A} from "./components/C2A";
import {DecorationOptions} from "./components/DecorationOptions";
import {ImagesGallery} from "./components/SwipeGallery";
function App({t}) {
return (
<div id="main">
<Header/>
<div className="text_wrapper">
<p><Trans i18nKey='intro1'/></p>
<p><Trans i18nKey='intro2'/></p>
<C2A/>
</div>
<div id="bg-img1" className="background_image" />
<DecorationOptions/>
<div id="bg-img2" className="background_image"/>
<ImagesGallery/>
<div id="temp_separator">
</div>
</div>
);
}
export default withTranslation('common')(App);
package.json:
{
"name": "ai",
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap": "^4.3.1",
"i18next": "^17.0.11",
"i18next-browser-languagedetector": "^3.0.3",
"react-bootstrap": "^1.0.0-beta.11",
"react-dom": "^16.9.0",
"react-i18next": "^10.12.2",
"react-image-gallery": "^0.9.1",
"react-scripts": "3.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
node_modulesand re-installing?reactdependency, simply run npm install react --save