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

Package incompatibility with Bun runtime and Docker #1

Open
Jajared opened this issue Feb 13, 2025 · 0 comments
Open

Package incompatibility with Bun runtime and Docker #1

Jajared opened this issue Feb 13, 2025 · 0 comments

Comments

@Jajared
Copy link

Jajared commented Feb 13, 2025

Description

When using debug-next (v0.3.0) with Bun runtime (v1.1.30), logging functionality doesn't work as expected. The logger initialization works in the main application file but fails to properly log in other modules/routes.

Environment

  • Bun: 1.1.30
  • debug-next: 0.3.0
  • OS: Linux (Docker container, with docker compose)

Steps to Reproduce

  1. Set up logger initialization in main app file:
import { LogBase } from 'debug-next'
LogBase.init('app-name', __dirname)
  1. Try to use logging in route files:
import { Log } from 'debug-next'
const { log } = Log()
log('Test message') // This fails to output

Current Behavior

  • Logging works in the main application file where LogBase is initialized
  • Logging fails silently in other modules/route files
  • No error messages are shown
  • Environment variables (DEBUG=app-name:*) are properly set

Expected Behavior

  • Logging should work consistently across all files
  • File paths should be automatically resolved
  • Namespace prefixing should work as documented

Attempted Solutions

  1. Tried using different environment configurations:
    • Setting DEBUG and FORCE_COLOR environment variables
    • Using different log levels
  2. Attempted to use ts-node-dev and nodemon as alternatives
  3. Tried various logger initialization approaches

Impact

This issue prevents proper debugging and monitoring in production environments when using Bun as the runtime. Currently requires falling back to Node.js for development to maintain logging functionality.

Additional Context

The issue appears to be related to how Bun handles module resolution and global state management differently from Node.js. The logger initialization state is not properly shared across modules in the Bun environment.

@Jajared Jajared changed the title Package incompatibility with Bun runtime Package incompatibility with Bun runtime and Docker Feb 13, 2025
@gtmetric gtmetric mentioned this issue Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant