Next.js Discord

Discord Forum

Hide some NextJS logs

Unanswered
Whiteleg shrimp posted this in #help-forum
Open in Discord
Whiteleg shrimpOP
Hi, It's possible to hide a log based on a regex or if it contains some word?

14 Replies

Asian black bear
It depends on what you use for your observability pipeline - pretty much all tools have ways to transform and filter data to prevent them from appearing in logs etc.
Whiteleg shrimpOP
It's more a development log
⚠ ./node_modules/.pnpm/@opentelemetry+instrumentat_04f370d515cee0be955272f826166073/node_modules/@opentelemetry/instrumentation/build/esm/platform/node
Package import-in-the-middle can't be external
The request import-in-the-middle matches serverExternalPackages (or the default list).
The request could not be resolved by Node.js from the project directory.
Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.
Try to install it into the project directory by running npm install import-in-the-middle from the project directory.


⚠ ./node_modules/.pnpm/@sentry+node@9.22.0/node_modules/@sentry/node/build/cjs/sdk
Package import-in-the-middle can't be external
The request import-in-the-middle matches serverExternalPackages (or the default list).
The request could not be resolved by Node.js from the project directory.
Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.
Try to install it into the project directory by running npm install import-in-the-middle from the project directory.
Logs like this get spammed almost 15 times in a row for every request and makes it impossible to debug using the console
@Anay-208 | Ping in replies Are you using turbopack?
Whiteleg shrimpOP
Yep
Can't you just try installing what is stated here, install import-in-the-middle
But then the error just changes package like this
Package @aws-sdk/client-s3 can't be external
The request @aws-sdk/client-s3 matches serverExternalPackages (or the default list).
The request could not be resolved by Node.js from the project directory.
Packages that should be external need to be installed in the project directory, so they can be resolved from the output files.
Try to install it into the project directory by running npm install @aws-sdk/client-s3 from the project directory.
It also happens with prettier and other more packages
And I have all this packages installed
Giant panda
Im not familiar with pnpm but the following may help: https://github.com/vercel/next.js/issues/68805
@Giant panda Im not familiar with pnpm but the following may help: https://github.com/vercel/next.js/issues/68805
Whiteleg shrimpOP
I will look to this tomorrow morning, thank you