Client side NPM



I’m following the guide at and I tried adding react-dragula ( to my app.

I’ve done meteor add meteorhacks:npm cosmos:browserify

My packages.json

  "externalify": "0.1.0",
  "react-dragula": "1.0.2"


dragula = require('react-dragula');


  "transforms": {
    "react-dragula": {
      "global": true,
      "external": {
        "react": "React.require"

But I get the following error:

'function' === typeof document.createEvent ? function CustomEvent (type, param
ReferenceError: document is not defined

At first I was thinking this was because document isn’t available on server so I moved it from /lib to /client but I still get the same error. Do I have to transform it with something else?

Edit: Trying instead with react-dnd I get this error:

   While building the application:
   lib\browserify\app.browserify.js: Unexpected object exported by the
   package. Expected a transform function.

Edit2: I removed the app.browserify.options.json and this makes react-dnd work (but not react-dragula). Will this be bad for my code?



I’m not sure, since the docs don’t explain how app.browserify.options.json works, but I think you need to just cut and paste from the guide. In other words, don’t change ‘externalify’ to ‘react-dragula’. That’s what I did and I at least got the app to build.

Of course it would be nice to actually understand what it’s doing.


That makes the most sense, not sure why I did that. I’ll try do something else. Cheers.