DimiMikadze / create-react-library

React NPM library starter kit based on Facebook's create react app
MIT License
602 stars 60 forks source link

Help: It looks like your Babel configuration specifies a module transformer. Please disable it #28

Closed Inateno closed 6 years ago

Inateno commented 6 years ago

Hi,

I'm using the default configuration and one of my modules trigger this error and I can't figure it out.

This module is causing the issue:

import dispatchStdEvent from "vr-ui/web_modules/utils/dispatch-std-event"

And here is the core of the module:

export default function dispatchStdEvent(stdEventName, bubbles, cancelable, element) {
  var newStdEvent
  if (bubbles === undefined || bubbles === null) {
    bubbles = true
  }
  if (cancelable === undefined || cancelable === null) {
    cancelable = true
  }
  try {
    newStdEvent = new Event(stdEventName, {"bubbles": bubbles, "cancelable": cancelable})
  }
  catch (e) {
    newStdEvent = document.createEvent("Event");
    newStdEvent.initEvent(stdEventName, bubbles, cancelable);
  }
  (element || window).dispatchEvent(newStdEvent)
}

This error occurs sometimes but the link given in the error doesn't give enough details since I'm using your default configuration I'm just lost, seems like it doesn't like the package for any reason (I can't find which one).

I got this issue few times with others modules and it was mainly because the export wasn't set to "default" or some strange things my mates did (ES8 requiring an extra module). But here, this one is so simple I have no ideas.

Thanks

Inateno commented 6 years ago

If I copy the whole content of my file "dispatchStdEvent" inside my package, it builds.

The problem comes only from import/export ?

DimiMikadze commented 6 years ago

Hi @Inateno

Babel configuration is exactly same as CRA's, i didn't have edited anything in there.

To be honest, i didn't understand what's your issue, but i see you've referenced issue from Rollup and we are not using Rollup in here at all, maybe accidentally you've opened issue in another repository?

Inateno commented 6 years ago

Ok my bad you are using the same name that https://github.com/transitive-bullshit/create-react-library and I looked for the github directly without passing by npm -_- (yours got a better seo on google lol).