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

ExceptionHandlers and rejectionHandlers doesn't work on winston log library with bun. #8234

Closed
malomiquel opened this issue Jan 17, 2024 · 2 comments
Labels
bug Something isn't working node.js Compatibility with Node.js APIs

Comments

@malomiquel
Copy link

malomiquel commented Jan 17, 2024

What version of Bun is running?

1.0.23+83f2432da

What platform is your computer?

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

You have to create a simple server project using bun.
Install winston library on project : https://www.npmjs.com/package/winston
Here is an code example:

const express = require("express");
const winston = require("winston");
const app = express();

const logger = winston.createLogger({
 transports: [new winston.transports.Console()],
 format: winston.format.combine(
  winston.format(function dynamicContent(info, opts) {
   info.message = "[dynamic content] " + info.message;
   return info;
  })(),
  winston.format.simple()
 ),
 exceptionHandlers: [
  new winston.transports.File({ filename: "exceptions.log" }),
 ],
 rejectionHandlers
});

//middleware
app.use(express.json());
// throw new Error("Something failed during startup.");
logger.info("Hello World");

app.listen(3001, () => {
 console.log("Server is running on port 3001");
});

module.exports = app;

What is the expected behavior?

On a node project, when you decomment this line throw new Error("Something failed during startup.");, it save the error in exceptions.log.
While, on a bun project nothing happen execpt print an error on console when you are in watch mode.

What do you see instead?

No response

Additional information

No response

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

This is likely because we need to implement #429 and uncaughtException.

@Electroid Electroid added the node.js Compatibility with Node.js APIs label Jan 17, 2024
@Electroid
Copy link
Contributor

Duplicate of #429

@Electroid Electroid marked this as a duplicate of #429 Jan 17, 2024
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2024
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