megawac / babel-plugin-ramda

Easy :ram: modular builds
311 stars 33 forks source link

Undefined imports #40

Open wpcarro opened 6 years ago

wpcarro commented 6 years ago

Version Info

Explanation

I've been having issues compiling my project using babel-plugin-ramda.

Here's what the source code import looks like:

import { compose, lensProp } from 'ramda'

And here's the error I'm receiving:

Uncaught ReferenceError: _lensProp is not defined

What's odd, is that if I change the import order to something like this:

import { lensProp, compose } from 'ramda'

The error changes to:

Uncaught ReferenceError: _compose is not defined

This plugin has worked for me in the past, but stopped working this past Thursday, and I've been unable to debug it since...

Here's what my babel configuration looks like:

  "babel": {
    "presets": [
      "react-app"
    ],
    "plugins": [
      "macros","ramda"
    ]
  },

Any insights into debugging this would be greatly appreciated!

wpcarro commented 6 years ago

After toiling this for a bit longer, I've realized that whatever the last import is in the list will be the one that's undefined.

For instance, if I had the following...

import { compose, lensProp } from 'ramda'

...lensProp will be undefined.

As a cheap workaround, I can do the following to get my code to compile:

import { compose, lensProp, map } from 'ramda'

This works because my module isn't using map. It's happening to my coworkers now too, so I'm unsure how to proceed. Considering dropping it and just using:

import R from 'ramda'

R.compose(..)
R.lensProp(..)
megawac commented 6 years ago

Point to 1.4.3 for now, looking into the issue. Thanks for reporting.

stephanschubert commented 6 years ago

I have the same/similar issue - but all named imports are undefined.

node 10.5.0, jest 23.4.1, ramda 0.25.0, and babel-plugin-ramda 1.6.2

BerekHalfhand commented 1 year ago

Nice job not fixing this in 5 years, the author should seek employment in game dev