react-email icon indicating copy to clipboard operation
react-email copied to clipboard

[bug] Dev server not starting

Open bastiaanv opened this issue 2 years ago • 2 comments

Currently, if you want to start the dev server, you will get the following error:

➜ npm run dev

> [email protected] dev
> email dev

✔ Emails preview generated
â ‹ Installing dependencies...

up to date, audited 584 packages in 3s

55 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (2 moderate, 5 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

✔ Dependencies installed

> [email protected] dev
> next dev 3000

error - Invalid project directory provided, no such directory: /Users/bastiaanverhaar/Desktop/Darwin/outbound-communications/.react-email/3000

Specs:

  • OS: MacOS 13.1
  • Terminal: iTerm2 with Fish shell
  • NodeJS: v18.13.0
  • Package manager: NPM & Yarn

bastiaanv avatar Jan 30 '23 08:01 bastiaanv

I found that the error is due to an incorrect shell command:

const startDevServer = (packageManager: string, port: string) => {
  shell.exec(`${packageManager} run dev -p ${port}`, { async: true });
}

This code should be:

const startDevServer = (packageManager: string, port: string) => {
  shell.exec(`${packageManager} run dev -- -p ${port}`, { async: true });
}

Source: https://stackoverflow.com/a/44743871

Will open a PR for it

bastiaanv avatar Jan 30 '23 08:01 bastiaanv

Having the same issue on Windows, specs:

  • OS: Windows 11 Home 22H2
  • NodeJS: v18.13.0
  • Package Manager: npm

socratesomiliadis avatar Jan 30 '23 11:01 socratesomiliadis

1.7.10 should fix this.

zenorocha avatar Jan 31 '23 02:01 zenorocha