Open randreu28 opened 10 months ago
Had the same issue. I found importing consola like this worked fine:
import {createConsola} from "consola/core";
To get the same behaviour as the default export, you need to:
Pretty sure this whole issue has something to do with this line: https://github.com/unjs/consola/blob/a440c4d4bbc39135a1514bcd78fcbaba2c571285/src/index.ts#L25C10-L25C10
Well, I was asking in the hopes that I don't have to copy paste the implementation of the reporters from the consola source code with only the parts that work well in my case. My issue is not the fact that there are no workarounds. It's the fact that there is a need for a workaround.
Appreciate the effort though!
Environment
I believe Next.js 14 uses Node v18 (LTS)
I haven't tried in Next.js 13 but I suspect it might get a similar issue
Reproduction
I created a repository to simulate the issue.
You can also check it live via this github codespace:
Describe the bug
Consola does not work well when logging in the server on Next.js 14:
It DOES work on the client:
I've tried using different imports, but I wanted to see it it was possible to use the fancy reporter with the colors :')
It might be my ignorance as to how loggers differ from browser rather than in the server, but shouldn't the server also be able to print colors?
Additional context
No response
Logs
No response