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
In a nitro project if you import LogLevels and then npm run build you get a fail with the following error
✔ Generated public .output/public nitro 9:19:46 PM
[nitro 9:19:47 PM] ℹ Building Nitro Server (preset: node-server, compatibility date: 2025-02-06)
[nitro 9:19:50 PM] ERROR RollupError: server/routes/index.ts (1:0): "LogLevels" is not exported by "node_modules/unenv/runtime/npm/consola.mjs", imported by "server/routes/index.ts".
1: import { LogLevels } from 'consola';
^
2:
3: export default eventHandler((event) => {
[9:19:50 PM] ERROR server/routes/index.ts (1:0): "LogLevels" is not exported by "node_modules/unenv/runtime/npm/consola.mjs", imported by "server/routes/index.ts".
at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:560:41)
at Module.error (node_modules/rollup/dist/es/shared/parseAst.js:556:42)
at Module.error (node_modules/rollup/dist/es/shared/node-entry.js:16635:29)
at Module.traceVariable (node_modules/rollup/dist/es/shared/node-entry.js:17084:29)
at ModuleScope.findVariable (node_modules/rollup/dist/es/shared/node-entry.js:14741:39)
at ReturnValueScope.findVariable (node_modules/rollup/dist/es/shared/node-entry.js:5602:38)
at FunctionBodyScope.findVariable (node_modules/rollup/dist/es/shared/node-entry.js:5602:38)
at MemberExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:7305:49)
at ReturnStatement.bind (node_modules/rollup/dist/es/shared/node-entry.js:2799:23)
at BlockStatement.bind (node_modules/rollup/dist/es/shared/node-entry.js:2795:28)
[9:19:50 PM] ERROR server/routes/index.ts (1:0): "LogLevels" is not exported by "node_modules/unenv/runtime/npm/consola.mjs", imported by "server/routes/index.ts".
Additional context
My main motivation is to be able to set the console level with the log level 'word'
Environment
Node: 18.20.3
NPM: 10.2.3
Reproduction
https://stackblitz.com/edit/github-zsdq7msk?file=server%2Froutes%2Findex.ts
In the terminal type
npm run build
Describe the bug
In a nitro project if you import LogLevels and then
npm run build
you get a fail with the following errorAdditional context
My main motivation is to be able to set the console level with the log level 'word'
VSCode understands the import and doesn't complain.
Logs
The text was updated successfully, but these errors were encountered: