sainsburys-tech / next-logger

JSON logging patcher for Next.js
MIT License
144 stars 14 forks source link

Does not work with yarn workspaces #8

Closed rohit-gohri closed 2 years ago

rohit-gohri commented 2 years ago

Error stacktrace:

Error: Cannot find module '/projects/workspace-root/apps/project-a/node_modules/next/dist/build/output/log'
Require stack:
- /projects/workspace-root/node_modules/next-logger/lib/patches/next.js
rohit-gohri commented 2 years ago

This can be fixed by using the resolve package instead of using path to find path of nextjs log file

atkinchris commented 2 years ago

@rohit-gohri - thanks for raising this, and the PR to fix it. This is something that came up before, and an implementation was published as a beta version. Could you try it, and see if it resolves your issue?

If so, I'll get it into main. If not, I'll get your PR in.

npm install "https://github.com/atkinchris/next-logger.git#v2.2.0-beta.0"
rohit-gohri commented 2 years ago

Could you try it, and see if it resolves your issue?

2.2.0-beta.0 fixes the issue! 🥳

atkinchris commented 2 years ago

Awesome - I'll get that promoted and released through npm!

atkinchris commented 2 years ago

I've merged the fix from 2.2.0-beta.0 into main, and it's been shipped in 2.2.0. Thanks for testing the fix!