6

When you do a simple console log in server API side, it doesn't show up when you build it using pnpm run dev.

dev environment

But if you build it using pnpm run build and run the index.mjs, the console log will show up.

Code:

export default defineEventHandler(async (event) => {
  console.log('HAHAHAHAHA');

  return 'LOGIN!';
});

Here is my npx nuxi info:

------------------------------
- Operating System: `Linux`
- Node Version:     `v18.12.1`
- Nuxt Version:     `3.0.0`
- Nitro Version:    `1.0.0`
- Package Manager:  `pnpm@7.22.0`
- Builder:          `vite`
- User Config:      `app`, `runtimeConfig`, `modules`, `ssr`, `vite`, `typescript`, `css`, `build`
- Runtime Modules:  `@app/ui@1.0.0-alpha`, `nuxt-icon@0.1.8`, `@pinia/nuxt@0.4.6`
- Build Modules:    `-`
------------------------------
BLNK
  • 123
  • 1
  • 12

0 Answers0