Skip to content
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

Bun's docker image has no support for rxjs when used as a runtime image #6450

Closed
NonsoAmadi10 opened this issue Oct 12, 2023 · 2 comments
Closed
Labels
bug Something isn't working node.js Compatibility with Node.js APIs

Comments

@NonsoAmadi10
Copy link

NonsoAmadi10 commented Oct 12, 2023

What version of Bun is running?

1.0.2

What platform is your computer?

Darwin 22.1.0 x86_64 i386

What steps can reproduce the bug?

I am running a nestjs application that uses rxjs to handle authentication in a oven/bun container, it turns out that when my container image is node, it handles rxjs well but when I switch to oven/bun, I get errors like this:

TypeError: Cannot call a class constructor without |new|
    at AsyncResource (node:async_hooks:125:14)
159.65.84.237 - - [05/Oct/2023:08:04:02 +0000] "GET /exchange/price HTTP/1.1" - - "-" "axios/0.21.1"
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/observable/defer.js:8:5)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:42:8)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:36:15)
    at errorContext (/usr/src/app/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:21:11)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:26:42)
    at doInnerSub (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:22:59)
    at outerNext (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:17:38)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:34:23)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Subscriber.js:53:15)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js:122:26)
    at processTicksAndRejections (:55:39)
[Nest] 1  - 10/05/2023, 8:04:08 AM   ERROR [ExceptionsHandler] Cannot call a class constructor without |new|
TypeError: Cannot call a class constructor without |new|
    at AsyncResource (node:async_hooks:125:14)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/observable/defer.js:8:5)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:42:8)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:36:15)
    at errorContext (/usr/src/app/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:21:11)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:26:42)
    at doInnerSub (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:22:59)
    at outerNext (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:17:38)
    at <anonymous> ```

### What is the expected behavior?

The expected behaviour is that the oven/bun runtime should be able to handle rxjs and reactive javascript dependencies with ease similar to how it is done on nodejs and without errors

### What do you see instead?


```bash
TypeError: Cannot call a class constructor without |new|
    at AsyncResource (node:async_hooks:125:14)
159.65.84.237 - - [05/Oct/2023:08:04:02 +0000] "GET /exchange/price HTTP/1.1" - - "-" "axios/0.21.1"
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/observable/defer.js:8:5)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:42:8)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:36:15)
    at errorContext (/usr/src/app/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:21:11)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:26:42)
    at doInnerSub (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:22:59)
    at outerNext (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:17:38)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:34:23)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Subscriber.js:53:15)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js:122:26)
    at processTicksAndRejections (:55:39)
[Nest] 1  - 10/05/2023, 8:04:08 AM   ERROR [ExceptionsHandler] Cannot call a class constructor without |new|
TypeError: Cannot call a class constructor without |new|
    at AsyncResource (node:async_hooks:125:14)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/observable/defer.js:8:5)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:42:8)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:36:15)
    at errorContext (/usr/src/app/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:21:11)
    at <anonymous> (/usr/src/app/node_modules/rxjs/dist/cjs/internal/Observable.js:26:42)
    at doInnerSub (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:22:59)
    at outerNext (/usr/src/app/node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js:17:38)
    at <anonymous> ```

### Additional information

_No response_
@NonsoAmadi10 NonsoAmadi10 added the bug Something isn't working label Oct 12, 2023
@Electroid
Copy link
Contributor

Duplicate of #5997

@Electroid Electroid marked this as a duplicate of #5997 Oct 12, 2023
@Electroid Electroid added the node.js Compatibility with Node.js APIs label Oct 12, 2023
@Electroid
Copy link
Contributor

This was fixed in a newer version of Bun, please upgrade!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node.js Compatibility with Node.js APIs
Projects
None yet
Development

No branches or pull requests

2 participants