No "Console.logs()" are output - Remix Template

Topic summary

Console.log statements were not appearing when running a Remix-based Shopify app locally (npm run dev) on macOS 14 with Node v18.12 and up-to-date Remix/Shopify packages. Logging was expected from a console.log placed inside an action function (app._index.ts), with logger set to debug.

Key clarification: Frontend console.log logs to the browser; backend/server logs appear in the terminal. In Remix, action functions run on form submissions or POST requests; loader functions run during page load/data fetching.

Troubleshooting steps: Compared with an older Remix tutorial project where logs appeared, leading to initial suspicion of package/CLI changes. A suggestion was made to confirm that something triggers the action and to try logging in the loader.

Outcome: The issue was a misunderstanding—action is not called at startup, so the server-side console.log won’t run until the action is invoked (e.g., via a form submit). No package or CLI problem was identified.

Status: Resolved; no further action needed.

Summarized with AI on January 3. AI used: gpt-5.

Hey,

No matter where I place my own Console.log(), no logs are output with the remix template. I have also set the logger to debug. I started locally with npm run dev.

I have looked at so many things. But I just can’t find a solution. My packages are the latest ones:

  • Package versions:

@remix-run/dev”: “^2.7.1”,
@remix-run/node”: “^2.7.1”,
@remix-run/react”: “^2.7.1”,
@remix-run/serve”: “^2.7.1”,
@shopify/app”: “3.57.0”,
@shopify/cli”: “3.57.0”,
@shopify/polaris”: “^12.0.0”,
@shopify/shopify-api”: “^9.2.0”,
@shopify/shopify-app-remix”: “^2.5.0”,

  • Node version: v18.12.0
  • Operating system: MacOS 14.0

Does anyone have any idea what the problem is?

Thank you :slightly_smiling_face:

Make sure you take a look at where your console.log code is. If its placed on the frontend, it will be logging to the browser/client side. If its on the backend, it will be logging to your console in VS code or wherever you are running your code.

Thanks for your reply. I also thought I was looking wrong. But if, for example, I add a console.log to app._index.ts within action in the remix template, it should be printed on the server side and thus in the terminal and not in the browser.

export const action = async ({ request }: ActionFunctionArgs) => {
  const { admin } = await authenticate.admin(request);
  console.log("test -----");

...
}

But unfortunately this does not happen.

I tried an other project from a YouTuber https://github.com/stefanoHTB/remix-youtube-tutorial. Because I thought I had done something wrong. But I think something about the new packages or cli no longer fits. The older packages in this projects work. And I can output everything via console.log.

Are you ensuring something is being submitted to your action function? Have you tried logging in the loader function?

You are totally right :roll_eyes: I thought the above action would also be called at startup. Sometimes you’re just in a programming tunnel!

Well, I hope that helps someone else too.
Thank you!