-
Notifications
You must be signed in to change notification settings - Fork 14
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
Next 13 compatibility #22
Comments
any updates on this topic? :) |
I've been digging into this with Next 14, and I'm hitting a blocker. The However, patching is my blocker at this stage. An Currently, we patch the prefix methods with basic assignment: Object.keys(nextLogger.prefixes).forEach(method => {
nextLogger[method] = getPinoMethod(method)
}) With Object.assign(nextLogger, { [method]: getPinoMethod(method) })
// TypeError: Cannot set property XXX of #<Object> which has only a getter
Object.defineProperty(nextLogger, method, { value: getPinoMethod(method) })
// TypeError: Cannot redefine property: XXX I'm investigating if I can redefine the entire object on the module export, to keep the reference but not the existing properties. I can redefine the entire exports object within the const cachePath = require.resolve('next/dist/build/output/log')
const cacheObject = require.cache[cachePath]
cacheObject.exports = { ...cacheObject.exports } |
Please can you try the new beta version, to see if this works for you? npm i next-logger@4.0.0-beta.1 |
Version 4.0.0 has been published, bringing Next 14 support! |
Hello !
It seems that next-logger is not working properly since Next 13.4.20 : vercel/next.js#54713
I may propose a PR when I have the time, but for now let's describe the issue.
The Next log format has changed, for example :
Now :
Before :
Since next-logger relies on logs prefixes, we now have log format errors :
Initial log :
Formatted log with next-logger :
The new log format is going to be complicated to format. Now there are multi-lines and special characters 😕
The text was updated successfully, but these errors were encountered: