Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run dev not opening port #747

Closed
sysmat opened this issue Jul 5, 2023 · 23 comments
Closed

npm run dev not opening port #747

sysmat opened this issue Jul 5, 2023 · 23 comments
Labels
Package: react-email This is the CLI we generally use as just `email` on the temrinal. Type: Bug Confirmed bug

Comments

@sysmat
Copy link

sysmat commented Jul 5, 2023

Describe the Bug

npm run dev -> nothing happend

Which package is affected (leave empty if unsure)

react-email

Link to the code that reproduces this issue

https://stackblitz.com/edit/stackblitz-starters-tcqzzt?file=react-email-starter%2Freadme.md

To Reproduce

  • npx create-email@latest
  • ncu -u
  • npm i
  • npm run dev -> nothing happend

Expected Behavior

to start dev server on http://localhost:3001 as in readme documentation

What's your node version? (if relevant)

Node: 18.16.0

@sysmat sysmat added the Type: Bug Confirmed bug label Jul 5, 2023
@bukinoshita
Copy link
Member

@sysmat Can you share more information? Is this on Mac? Windows? Linux?

Here's the same steps

CleanShot.2023-07-06.at.14.13.34.mp4

@bukinoshita bukinoshita added Resolution: Needs More Information More information is needed on this issue and removed Type: Bug Confirmed bug labels Jul 6, 2023
@bukinoshita bukinoshita changed the title "react-email": "1.9.4" nothing works npm run dev not opening port Jul 6, 2023
@sysmat
Copy link
Author

sysmat commented Jul 7, 2023

@bukinoshita on windows power shell

react_email

@zedo-san
Copy link

zedo-san commented Jul 7, 2023

I also have the same setup and is experiencing the same issue

@Rivoks
Copy link

Rivoks commented Jul 9, 2023

Hello me too, when launching npm run dev it is starting and then closing immediately the process.
Node version: v19.8.1

@mortocks
Copy link

mortocks commented Jul 11, 2023

+1

node 18.16.0
pnpm 8.6.3

on Mac

@bukinoshita
Copy link
Member

All windows? Or anyone having this issue on Mac?

@mezg0
Copy link

mezg0 commented Jul 12, 2023

Yeah same issue for me on Mac

@mortocks
Copy link

All windows? Or anyone having this issue on Mac?

Mac (sorry should have said). M2 running 13.4.1

@mortocks
Copy link

Today (24 hours after my original post) it suddenly started working (no changes to the code base or system restarts. The first thing it did was download a bunch of dependancies.

I'm wondering if perhaps a host for one of these dependancies was down and there's no error handing in the startup process? 🤷‍♂️

Just a new data point

@bighoho123
Copy link

Same here.
Mac M1 react-email@1.9.4

Running email script exits immediately (without error)

Cursor_and_Hyper

@bighoho123
Copy link

npm uninstall react-email
then
npm install react-email -D -E fixed my issue

@zedo-san
Copy link

I tried installing the previous version "react-email": "1.9.0" and it works fine for me. I'm using a windows machine. Here's my full package.json file

{
  "name": "react-email-p1",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "email dev"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@react-email/button": "0.0.7",
    "@react-email/components": "0.0.4",
    "@react-email/container": "0.0.8",
    "@react-email/html": "0.0.4",
    "@react-email/tailwind": "0.0.7",
    "react-email": "1.9.0"
  }
}

@bukinoshita bukinoshita added Type: Bug Confirmed bug Package: react-email This is the CLI we generally use as just `email` on the temrinal. and removed Resolution: Needs More Information More information is needed on this issue labels Jul 14, 2023
@stbensonimoh
Copy link

I had the same issue. I had to use npx react-email dev instead of npm run dev before it worked for me.

@Rivoks
Copy link

Rivoks commented Jul 22, 2023

With the latest version 1.9.4 i got this error when I run the npm dev:

> email dev --port 8888 --dir src/emails

(node:30994) [DEP0164] DeprecationWarning: Implicit coercion to integer for exit code is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)

I am on Mac OS 13.2.1 and on a M1 chipset.

@EavOutDom
Copy link

EavOutDom commented Sep 23, 2023

I also have the same issue on windows

@Aleksandern
Copy link

react-email downloads the client code on the start (about 24 MB) so make sure you have a good internet connection or just wait for a while.
That was my issue.

@gabrielmfern
Copy link
Collaborator

This should not happen the same as of react-email@2.0.0 and should now be fixed.

Check the changelog and our blog post for more info on this.

If anyone is still experiencing this with 2.0.0 let me know and I'll reopen this issue.

@Yashhh08
Copy link

Yashhh08 commented Feb 9, 2024

$ npm run email

> emails@0.1.0 email
> email dev

    React Email 2.0.0
    Running preview at:          http://localhost:3000

  ⠙ Getting react-email preview server ready...
Error: > Couldn't find any `pages` or `app` directory. Please create one under the project root
    at findPagesDir (D:\Yash Yerunkar\Email Templates\emails\node_modules\react-email\node_modules\next\dist\lib\find-pages-dir.js:42:15)
    at initialize (D:\Yash Yerunkar\Email Templates\emails\node_modules\react-email\node_modules\next\dist\server\lib\router-server.js:71:69)
    at async NextCustomServer.prepare (D:\Yash Yerunkar\Email Templates\emails\node_modules\react-email\node_modules\next\dist\server\next.js:240:28)

shutting down dev server

getting above issue my package.json configs are as below:

{
"name": "emails",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"email": "email dev"
},
"dependencies": {
"@react-email/components": "0.0.14",
"next": "14.1.0",
"react": "^18",
"react-dom": "^18",
"react-email": "2.0.0"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
}

@codeScourge
Copy link

I am still having this issue on Windows (inside WSL) when working with Bun on the latest version of react-email@2.1.1
I can get it to work by downgrading to react-email@1.9.0

When starting, it just automatically closes the dev server without any error:

scourge@ivan:/mnt/c/Users/codes/code/playground/react-email-starter$ bun dev
$ email dev
    React Email 2.1.1
    Running preview at:          http://localhost:3000

  ⠙ Getting react-email preview server ready...

shutting down dev server

@gabrielmfern
Copy link
Collaborator

@codeScourge Could you provide a reproduction for this? Seems to be another issue other than the one here.

@codeScourge
Copy link

@codeScourge Could you provide a reproduction for this? Seems to be another issue other than the one here.

Hi, thank you for helping. Here is the reproduction: https://github.com/codeScourge/react-email
There are some more details in the ReadME

@gabrielmfern
Copy link
Collaborator

gabrielmfern commented Apr 23, 2024

@codeScourge I think I've figured it out. When running on WSL you might have not installed Node at all, in that case, it seems like it fails the same you mentioned. It also fails the same way when running with bun --bun dev while having Node installed. So it seems like bun falls back to running with its runtime if Node isn't installed, so basically it runs bun --bun dev. Haven't checked on their code and I couldn't find anything related to this on their docs.

Could you open an issue with your reproduction and this documented as well? Some error might be happening due to some incompatibility with bun, and I'll try taking a look right now. Just want to move our conversation there instead.

@codeScourge
Copy link

@codeScourge I think I've figured it out. When running on WSL you might have not installed Node at all, in that case, it seems like it fails the same you mentioned. It also fails the same way when running with bun --bun dev while having Node installed. So it seems like bun falls back to running with its runtime if Node isn't installed, so basically it runs bun --bun dev. Haven't checked on their code and I couldn't find anything related to this on their docs.

Could you open an issue with your reproduction and this documented as well? Some error might be happening due to some incompatibility with bun, and I'll try taking a look right now. Just want to move our conversation there instead.

Sure, it is up at #1429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react-email This is the CLI we generally use as just `email` on the temrinal. Type: Bug Confirmed bug
Projects
None yet
Development

No branches or pull requests