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
When I swap out process.env.NEXT_RUNTIME for env.NEXT_RUNTIME with all the configs and console logs, it seems to try importing the node package and throws a module resolution issue.
import { env } from "./env";
export async function register() {
console.log("env", env.NEXT_RUNTIME);
console.log("process.env", process.env.NEXT_RUNTIME);
if (env.NEXT_RUNTIME === "nodejs") {
console.log("instrumentation registering");
await import("./instrumentation.node");
}
}
This is a weird issue because all the console logs work well during next dev. They write out nodejs. But when I load a route, I don't see the logs but an error is thrown.
This error is not thrown if I change the check to process.env.NEXT_RUNTIME === 'nodejs'.
I have it wired up to next.config too with the jiti.
Is next doing some funny stuff here why its not working with your library?
The text was updated successfully, but these errors were encountered:
I'm trying to use this package when following this open telemetry example: https://nextjs.org/docs/app/building-your-application/optimizing/open-telemetry
When I swap out
process.env.NEXT_RUNTIME
forenv.NEXT_RUNTIME
with all the configs and console logs, it seems to try importing the node package and throws a module resolution issue.This is a weird issue because all the console logs work well during
next dev
. They write outnodejs
. But when I load a route, I don't see the logs but an error is thrown.This error is not thrown if I change the check to
process.env.NEXT_RUNTIME === 'nodejs'
.I have it wired up to next.config too with the jiti.
Is next doing some funny stuff here why its not working with your library?
The text was updated successfully, but these errors were encountered: