-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ramda bundling issue as of 0.8.19 #605
Comments
I'm unable to reproduce the issue. Here's what I tried: // rambda-demo.mjs
import * as R from 'ramda';
const rows = [
{ subscriptionType: 'a', value: 1 },
{ subscriptionType: 'a', value: 2 },
{ subscriptionType: 'b', value: 3 },
{ subscriptionType: 'b', value: 4 },
];
const rowsBySubType = R.groupBy((row) => row.subscriptionType, rows);
console.log(rowsBySubType); Both Since I can't reproduce it, it might be something more specific to your setup. Do you have a way for me to reproduce the issue? For example, are you able to share a code sample containing the issue? |
Oh, interesting. Thank you for taking the time to try to reproduce it. I'll
come up with the smallest reproducible test case I can find in the next day
or two and update the issue.
-R
…On Wed, Dec 16, 2020 at 3:45 PM Evan Wallace ***@***.***> wrote:
I'm unable to reproduce the issue. Here's what I tried:
// rambda-demo.mjsimport * as R from 'ramda';
const rows = [
{ subscriptionType: 'a', value: 1 },
{ subscriptionType: 'a', value: 2 },
{ subscriptionType: 'b', value: 3 },
{ subscriptionType: 'b', value: 4 },];
const rowsBySubType = R.groupBy((row) => row.subscriptionType, rows);console.log(rowsBySubType);
Both node rambda-demo.mjs and esbuild --bundle rambda-demo.mjs | node
produce the same output and neither crashes. This is with esbuild version
0.8.23 (the latest version).
Since I can't reproduce it, it might be something more specific to your
setup. Do you have a way for me to reproduce the issue? For example, are
you able to share a code sample containing the issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#605 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7LAHXBIFAJCA4O7HPPCJLSVEL5FANCNFSM4U6GW57Q>
.
|
OK I can trivially reproduce this using your file if I include the --bundle
flag in the build command. Once you untar the attachment:
cd ramda-test
yarn install
npx esbuild src/ramda-test.ts --bundle --platform=node --outdir=dist
The resulting .js file will not actually include any code related to
groupBy.
Again I may be misunderstanding the intent of the --bundle flag, so tell me
if this not what I should actually be doing!
…On Wed, Dec 16, 2020 at 4:38 PM Ryan Scharer ***@***.***> wrote:
Oh, interesting. Thank you for taking the time to try to reproduce it.
I'll come up with the smallest reproducible test case I can find in the
next day or two and update the issue.
-R
On Wed, Dec 16, 2020 at 3:45 PM Evan Wallace ***@***.***>
wrote:
> I'm unable to reproduce the issue. Here's what I tried:
>
> // rambda-demo.mjsimport * as R from 'ramda';
> const rows = [
> { subscriptionType: 'a', value: 1 },
> { subscriptionType: 'a', value: 2 },
> { subscriptionType: 'b', value: 3 },
> { subscriptionType: 'b', value: 4 },];
> const rowsBySubType = R.groupBy((row) => row.subscriptionType, rows);console.log(rowsBySubType);
>
> Both node rambda-demo.mjs and esbuild --bundle rambda-demo.mjs | node
> produce the same output and neither crashes. This is with esbuild version
> 0.8.23 (the latest version).
>
> Since I can't reproduce it, it might be something more specific to your
> setup. Do you have a way for me to reproduce the issue? For example, are
> you able to share a code sample containing the issue?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#605 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB7LAHXBIFAJCA4O7HPPCJLSVEL5FANCNFSM4U6GW57Q>
> .
>
|
Attaching test file: |
Sorry, I just re-read your comment and realize you yourself are using --bundle — in my case it's the addition of --platform=node that's causing it to fail. |
Thanks! I can reproduce the issue now. I’ll fix it in the next release. |
I have an extremely basic use case of bundling a TS node project that makes use of Ramda's groupBy function to shape data coming back from Postgres:
When I bundle the file using esbuild 0.8.18, it correctly generates a module reference in the resulting js file:
However when I bundle it using esbuild 0.8.19 or above, the require_groupBy section is missing entirely, leading to a reference error when groupBy is invoked. I honestly think it's odd that this hasn't been reported before given how common Ramda is, and maybe there's something weird in my setup that I'm not seeing, but I'm going to have to pin 0.8.18 until this is either addressed or somebody can explain what I'm doing wrong. Thanks!
The text was updated successfully, but these errors were encountered: