I'm trying to deploy my react app to github pages but facing some errors.
At first, when I tried to run npm run deploy in the terminal, it showed me this error:
new MiniCssExtractPlugin({
^
And MiniCssExtractPlugin is not a constructor
After that, I tried: npm i -D --save-exact mini-css-extract-plugin@2.4.5
This solved the problem but when I ran it again (npm run deploy), I get this error:
Creating an optimized production build...
Failed to compile.
The target environment doesn't support dynamic import() syntax so it's not possible to use
external type 'module' within a script
I don't know why it doesn't work, and also didn't find anything on the internet.
Thanks!