Unable to deploy code to synthetics using node.js project

I have been trying to deploy the following code to synthetics using the Synthetics project setup.

I can deploy with node.js (npx) for a lightweight monitor and it works fine.

This code is just ignored. It is in the journeys directory, and permissions are good.

What am I missing for creating a journey?

import { journey, step, monitor, expect } from '@elastic/synthetics';
journey('Linadm PHP Journey', async ({ page, browser, context }) => {
  monitor.use({
    id: 'Example PHP Monitor',
    schedule: 1,
  });
  step('Go to http://www.example.com/index.php', async () => {
    await page.goto('http://www.example.com/index.php');
  });
  step('Click on username input', async () => {
    await page.locator('input[name="username"]').click();
  });
  step('Fill in username', async () => {
    await page.locator('input[name="username"]').fill('testuser');
  });
  step('Press Tab after username', async () => {
    await page.locator('input[name="username"]').press('Tab');
  });
  step('Fill in password', async () => {
    await page.locator('input[name="password"]').fill('testuser1');
  });
  step('Press Enter after password', async () => {
    await page.locator('input[name="password"]').press('Enter');
  });
  step('Click Logout button', async () => {
    await page.getByRole('button', { name: 'Logout' }).click();
  });
});

If your journey is being ignored when using the Synthetics project setup, here are key things to check:

  1. File location and naming: Ensure the file is inside the journeys/ folder and ends with .journey.js or .journey.ts.
  2. Monitor registration: Confirm that monitor.use() is declared inside the journey() callback, as in your code.
  3. Dry run: Run npx @elastic/synthetics . --dry-run to verify if the journey is being picked up. If it doesn't appear, it's likely a file naming or path issue.
  4. Push to Elastic: If you're pushing to Kibana-managed Synthetics, make sure you've run npx @elastic/synthetics init and then deploy with:
npx @elastic/synthetics push
  1. Unique monitor ID: The id inside monitor.use() must be unique per monitor. Duplicates may silently fail.
  2. Debug logs: Use DEBUG=* npx @elastic/synthetics push to see if there are internal errors.

Let me know what --dry-run outputs — that usually clarifies if the journey is being recognized.