Closed devinrhode2 closed 2 years ago
actually, this does mean something.
The next methods just directly call console
: https://github.com/vercel/next.js/blob/canary/packages/next/build/output/log.ts
In my environment, I basically don't really want to use the next patch. It's simpler to just use the console patch.
Also means I can reclaim my usage of yarn link
and, nobody gets confused on how this next patching works, or gets confused with double tracking logs.. etc..
And, I'm reversing my decision. I think it's cleaner to patch the nextLogger methods, despite the quirky nature of the monkey patch.
Next passes in chalk.red('error') -
into console.error
and filtering that out, especially if you get encoded color data, is really annoying. Better to just avoid letting next call chalk
in the first place.
Also, yalc link
does not have same issue as yarn link
. Go figure! yalc FTW!
Original title:
next-only patch is no longer utilized in next v12
In next v12, it seems that the next-only patch now no longer does anything.
I noticed only logs from the console patch were coming through, and then I tried this:
set my
"start": "...script..."
to just--require next-logger/presets/next-only
and... nothing happened.Although I've glanced at next.js canary branch today and see that there are calls made to this logger.
UPDATE: Next.js DOES still call these methods, obviously these are using the internal logger:
The patch is happening before these logs, and the logs are coming through.. but an error should be throw instead of these logs coming through
node v16.14.2
UPDATE: Turns out this does not happen when next-logger is installed normally. I am using![CleanShot 2022-04-14 at 21 42 26](https://user-images.githubusercontent.com/539816/163509692-4939d50b-b7d0-4dbe-8651-840263e31897.png)
cd next-logger && yarn link && cd ../myapp && yarn link "next-logger"
Sad day for
yarn link
:)