-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
The compilation was failing using YARN BUILD with Next.js 10 and React.js 17:
Failed to compile.
Error: Expected an opening square bracket.
> Build error occurred
Error: > Build failed because of webpack errors
at ...\node_modules\next\dist\build\index.js:15:918
at async ...\node_modules\next\dist\build\tracer.js:3:470
error Command failed with exit code 1.
To fix it, I replaced the code in postcss.config.js with this one :
module.exports = {
plugins: {
'postcss-flexbugs-fixes': {},
'postcss-preset-env': {
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
features: {
'custom-properties': false,
},
},
'@fullhuman/postcss-purgecss': {
content: [
'./pages/**/*.{js,jsx,ts,tsx}',
'./components/**/*.{js,jsx,ts,tsx}'
],
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
safelist: ["html", "body"]
},
'tailwindcss': {}
}
}
Metadata
Metadata
Assignees
Labels
No labels