react-side-effect: 1.1.4 is broken

Your patch release changed the module exports. react-document-title is now broken

×
TypeError: withSideEffect is not a function
./node_modules/react-document-title/index.js
node_modules/react-document-title/index.js:37
  34 |   }
  35 | };
  36 | 
> 37 | module.exports = withSideEffect(
  38 |   reducePropsToState,
  39 |   handleStateChangeOnClient
  40 | )(DocumentTitle);

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 11
  • Comments: 43 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I did submit this anyways, but likely given the context should be a SemVer Major since it is breaking change.

https://github.com/gaearon/react-document-title/issues/55

Bingo. I’m gonna hit up one of the webpack guys to figure this out.

Likewise. This is causing our projects with react-document-title to fail.

Yes, if instead of allowing semver to update security patches they lock down even their transitive dependencies (which react-document-title does not do) they will not be affected. I don’t think you should be using that as a shield though.

Ok, I tested it on my build server just to be sure. If 1.1.3 is installed everything is fine. If I let 1.1.4 install transitively it breaks the tests. I don’t have a good explanation for why, but it is broken. Judging by the reactions to the top post I am not alone.

Would you consider unpublishing until it gets sorted out?

I think I’ve narrowed it down. react-document-title doesn’t use a transpiler, so its require('react-side-effect') is used “bare”, without the _interopRequireDefault that most projects seem to use. But as of 1.1.4, this project now exposes “module” in it’s package.json, which uses a default es2015 export.

So if you’re using a “module” aware build system, such as webpack>=2, then require('react-side-effect') will return an object with default as a key.

Ok, something is caching something. Maybe webpack. If I install with 1.1.4 then paste in either the unpkg 1.1.3 or 1.1.4 I still get that error.

If I npm react-side-effect@1.1.3 the issue goes away…