React-styleguidist: TypeError: Object.entries is not a function

Created on 4 May 2018  Â·  3Comments  Â·  Source: styleguidist/react-styleguidist

This is no longer an issue for me, but I just wanted to make sure that other devs don't run into the same issue that I did. When I was trying to add scripts via the template in the styleguide.config.js file, I kept receiving the following error:

TypeError: Object.entries is not a function

This was my configuration:

const path = require('path')

module.exports = {
  webpackConfig: require('./build/webpack.config.styleguide.js'),
  components: 'patternLibrary/**/*.{js,jsx,ts,tsx}',
  styleguideComponents: {
    Wrapper: path.join(__dirname, 'patternLibrary/theme')
  },
  template: {
    favicon: '//res.cloudinary.com/roa-canon/image/upload/v1508867160/favicon.ico',
    head: {
      scripts: [
        {
          src: 'https://use.typekit.net/bfw8xpa.js'
        }
      ]
    }
  },
  ignore: ['**/theme/**/*.{js,jsx,ts,tsx}']
}

I spent a bunch of time trying to create an example that matched the setup we had for our project's codebase. I managed to get it set up similarly yet it wasn't erring out. I finally just googled the error itself. Turns out the reason why it was running successfully on my example and not on our legacy codebase was so simple and I noticed when I did node -v in both codebases.

The project codebase returned the following:
v6.6.0
The example codebase I was running returned the following:
v7.7.1

I was using ndenv to set versions of node in various project, the version I was running in our project didn't have support for Object.entries. Be sure to use a later version of node! Hopefully this helps some other developers if they are running into something similar!

bug

Most helpful comment

All 3 comments

We don't use Object.entries, are you sure it's from Styleguidist?

:tada: This issue has been resolved in version 7.0.11 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings