nextjs-multilanguage-website icon indicating copy to clipboard operation
nextjs-multilanguage-website copied to clipboard

Error: Expected an opening square bracket.

Open guydumais opened this issue 4 years ago • 1 comments

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': {}
  }
}

guydumais avatar Feb 18 '21 10:02 guydumais

Hey @guydumais thanks for your comment and sorry for the super late response.

Could you try now to see if it's working correctly? We changed many things in the tutorial, now that we have a new React SDK:

https://www.npmjs.com/package/@storyblok/react

https://www.storyblok.com/tp/next-js-react-guide

fgiuliani avatar Jun 08 '22 14:06 fgiuliani