generated from krauters/typescript-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
@krauters/logger relies on winston, which depends on Node.js modules like fs. This causes frontend builds (e.g., React, Next.js) to fail since fs is unavailable in the browser.
Steps to Reproduce
- Install
@krauters/loggerin a Next.js or React project. - Import it in a client component or shared module.
- Run the app and observe the build error:
Module not found: Can't resolve 'fs'
Expected Behavior
The logger should work on the backend while gracefully handling frontend usage without breaking.
Potential Fixes
- Ensure
winstonis only used in backend contexts. - Use a conditional import (
typeof window === 'undefined'). - Provide a fallback logger for frontend.
- Update
next.config.jsto excludefsfrom client builds.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working