# Unable to deploy code to synthetics using node.js project

**URL:** <https://discuss.elastic.co/t/unable-to-deploy-code-to-synthetics-using-node-js-project/377765>\
**Category:** Elastic Observability\
**Created:** [May 2, 2025, 5:52pm UTC](https://discuss.elastic.co/t/unable-to-deploy-code-to-synthetics-using-node-js-project/377765 "2025-05-02T17:52:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig\_Sharp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craig_sharp/32/80024_2.png) [@Craig\_Sharp](https://discuss.elastic.co/u/Craig_Sharp)\
**Post date:** [May 2, 2025, 5:52pm UTC](https://discuss.elastic.co/t/unable-to-deploy-code-to-synthetics-using-node-js-project/377765/1 "2025-05-02T17:52:18Z")

</div>

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?

```auto
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();
  });
});

```

---

<div class="post-metadata">

**Author:** ![Rafa\_Silva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafa_silva/32/147814_2.png) [@Rafa\_Silva](https://discuss.elastic.co/u/Rafa_Silva)\
**Post date:** [May 3, 2025, 3:19am UTC](https://discuss.elastic.co/t/unable-to-deploy-code-to-synthetics-using-node-js-project/377765/2 "2025-05-03T03:19:33Z")

</div>

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:

```auto
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.
