Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Expected an opening square bracket. #19

Open
guydumais opened this issue Feb 18, 2021 · 1 comment
Open

Error: Expected an opening square bracket. #19

guydumais opened this issue Feb 18, 2021 · 1 comment

Comments

@guydumais
Copy link

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': {}
  }
}
@fgiuliani
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants