Skip to content

Version update of 'stringify-update' dependency can break things #71

@drichard

Description

@drichard

This recent commit bumped the version of stringify-object from 2.4.1 to 3.1.0.

stringify-object now publishes their code only in ES2015 syntax. This is a problem as react-element-to-jsx-string is a dependency of chai-enzyme which is often run in non-ES2015 environments (e.g. PhantomJS) with webpack.

People usually do not transpile their node_modules dependencies down to ES5 because they expect them to be published as ES5 already.

This possibly breaks a few builds and npm scripts around the world as people can't run npm test in their react apps anymore without fixing up their webpack config.

Possible error output:

PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  SyntaxError: Unexpected token 'const'
  at webpack:///~/stringify-object/index.js:2:0

Possible workaround is to manually run the affected modules through babel in your webpack config. Add another loader like this:

{
  test: /\.js$/,
  // transpile stringify-object and its dependency
  include: [/stringify-object|get-own-enumerable-property-symbols/],
  loader: 'babel-loader'
}

TLDR: Many react/webpack apps use chai-enzyme which has dependency on this project which has now a dependency on a ES2015 module which doesn't get automatically transpiled under most circumstances. This is a not a bug in this project but rather an inconvenience. What should we do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions