fullstack-build / tslog

📝 tslog - Universal Logger for TypeScript and JavaScript
https://tslog.js.org
MIT License
1.29k stars 60 forks source link

formatWithOptions is Undefined: [BUG] #238

Closed mihirgarg01 closed 11 months ago

mihirgarg01 commented 1 year ago

Describe the bug Upon running the example code for tslog, I recive an error: 'TypeError: formatWithOptions is not a function.' Here's the entire error: pastebin.com

To Reproduce

  1. Use bunjs v0.6.8
  2. Install tslog
  3. Create a file called logger.ts
  4. Use example code found from readme.md
  5. In WSL, run bun run logger.ts
  6. See error in console

Expected behavior "Hello World" should have been returned in the console.

Screenshots Code & Error

Additional context I am using bunjs, not nodejs. Entirely possible that's the issue.

Node.js Version Bunjs 0.6.8

OS incl. Version Ubuntu 22.04.2 LTS on WIndows 10

drewbitt commented 11 months ago

Bun encourages opening issues with Bun when libraries fail. It the mission of Bun to be node library compatible.

terehov commented 11 months ago

Seems like it's an issue with bun and formatWithOptions is not supported yet.

Have a look: https://bun.sh/docs/runtime/nodejs-apis

node:util

🟡 Missing util.MIMEParams util.MIMEType util.formatWithOptions()...

mgcrea commented 3 months ago

This has been fixed with bun@1.1.0 and is now working, see https://bun.sh/docs/runtime/nodejs-apis#node-util.