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

Attempted to assign to readonly property with external package #8302

Closed
titivermeesch opened this issue Jan 20, 2024 · 3 comments
Closed

Attempted to assign to readonly property with external package #8302

titivermeesch opened this issue Jan 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@titivermeesch
Copy link

What version of Bun is running?

1.0.24+6fa35839c

What platform is your computer?

Darwin 23.2.0 arm64 arm

What steps can reproduce the bug?

  1. Start a clean Bun project
  2. Setup the following code (including installing Ably package through npm)
import Ably from "ably";
const ably = new Ably.Rest({ key: "key:key" });
ably.auth.requestToken({}, (err, res) => {
  console.log(err, res);
});

What is the expected behavior?

The code should complain about wrong authentication or correctly process the request

What do you see instead?

15:08:38.596 Ably: Auth.requestToken(): token request API call returned error; err = RequestError: Attempted to assign to readonly property.
ABLY FAILED
1122 | var Utils = tslib_1.__importStar(__webpack_require__(2));
1123 | function toString(err) {
1124 |     var result = '[' + err.constructor.name;
1125 |     if (err.message)
1126 |         result += ': ' + err.message;
1127 |     if (err.statusCode)
                   ^
error: RequestError: Attempted to assign to readonly property.

Additional information

I set up a reproduction repo here: https://github.com/titivermeesch/bun-ably-error-reproduction
The script npm run run-bun fails, but when using npm run run-node it works as expected. The first one uses bun and the second one uses Node v20.11.0)

@titivermeesch titivermeesch added the bug Something isn't working label Jan 20, 2024
@Electroid
Copy link
Contributor

Possibly related to #8258

@jdalton
Copy link
Contributor

jdalton commented Jan 22, 2024

@dylan-conway
Copy link
Member

Fixed in bun v1.1.9 with #11082

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

No branches or pull requests

4 participants