I have an issue which I cannot figure out.
I’m using console.log
. In production the log works only in top level module, but not inside a function.
In dev it works everywhere.
Example:
console.log("tady1");
export default function getData() {
console.log("tady2");
return {key: 1};
}
When I call the function getData in production the log statemant that prints “tady2” is not executed, but the first one (which prints “tady1” is.
In dev mode both are executed.
I have
compiler: {
removeConsole: false,
}
next configuration.
Here is a minimal example https://github.com/jira-zz/next-logging-test
1