You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use @elastic/ecs-pino-format in my Next.js app, and it's working mostly fine. However, whenever a logger instance is created I get the following error in my console:
⚠ ../../node_modules/@elastic/ecs-pino-format/index.js
Module not found: Can't resolve 'elastic-apm-node' in '/Users/petter/workspace/domstol/lovisa_core/node_modules/@elastic/ecs-pino-format'
Import trace for requested module:
../../node_modules/@elastic/ecs-pino-format/index.js
../../shared_library/frontend/logging/src/server.ts
../../shared_library/frontend/feature-toggles/src/backend.ts
../../shared_library/frontend/feature-toggles/src/index.ts
./src/app/layout.tsx
This seems to only happen during development in a Next.js app not using turbopack, so it's not a huge issue. Is there any way to stop these log messages?
Also seems to happen with the @elastic/ecs-winston-format package.
I've looked some more into this. It seems that whenever there is a require somewhere in a file, webpack will try to resolve it. Even if the require expression is never run. Because of this there doesn't seem to be a simple fix for this issue.
Since this is only an issue in Next.js with webpack (AFAIK) it isn't a big deal for us at least since turbopack will soon be the new standard anyways.
I'm trying to use
@elastic/ecs-pino-format
in my Next.js app, and it's working mostly fine. However, whenever a logger instance is created I get the following error in my console:This seems to only happen during development in a Next.js app not using turbopack, so it's not a huge issue. Is there any way to stop these log messages?
Also seems to happen with the
@elastic/ecs-winston-format
package.Reproduction
CodeSandbox
The text was updated successfully, but these errors were encountered: