Closed anishg-cn closed 2 years ago
Try the solution here: https://stackoverflow.com/a/52693007
@ysulyma I have seen this solution but it is for ejected react project but the project I am working on is not ejected. Can you provide a solution which will not require me to eject the react project?
@anishg-cn can you provide more of your config? What version of create-react-app are you using? I tried with a fresh CRA project and it worked fine (after downgrading to React 17—we will have a new major release supporting React 18 soon).
To downgrade CRA to React 17:
npm install react@17.x react-dom@17.x
then change the following in src/index.js
:
// import ReactDOM from 'react-dom/client';
import ReactDOM from 'react-dom';
// const root = ReactDOM.createRoot(document.getElementById('root'));
// root.render(
// <React.StrictMode>
// <App />
// </React.StrictMode>
// );
const root = document.getElementById('root');
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
root
);
@ysulyma I am using CRA 3.4, should I upgrade my react-scripts to 4.0?
@anishg-cn 4.0 will also have Babel issues due to ??
operator, react-scripts@5.x
should work
@ysulyma it worked by upgrading the react-scripts to 5, thanks
I upgraded the Liqvid package in my React project from 2.0 to 2.1 and now when I try to run the project using
npm start
it is throwing the following error in the command line:SyntaxError: ..\node_modules\liqvid\dist\liqvid.mjs: Support for the experimental syntax 'classProperties' isn't currently enabled (2052:12)
@ysulyma can you please check this?