Whenever I run `dev`, the process oftentimes doesn't shut down correctly and it ends up needing to u

Whenever I run dev, the process oftentimes doesn't shut down correctly and it ends up needing to use a different port every time. I get errors like this: ✘ [ERROR] Address already in use (127.0.0.1:60392). Please check that you are not already running a server on this address or specify a different port with --port. So I have to run the following:
lsof -i :60392
kill -9 <PID>
lsof -i :60392
kill -9 <PID>
Is there a way to avoid this or fix this? I feel like this is some known issue. When I searched about it online, I think folks are saying it's due to the hot-reloading feature, but this seems like a fundamental issue.
13 Replies
ccostes
ccostes4mo ago
👋 Trying to figure out how to set up my local directory structure for a project with Pages and Workers which need to access D1. Seems like wrangler gnerally expects to be in the same directory as the pages/worker project. Anybody know of examples of a multi-component project like this?
project
- pages_dir
- src/
...
- worker1
...
- wranger.toml
project
- pages_dir
- src/
...
- worker1
...
- wranger.toml
I currently have separate the worker and pages projects in separate directories with their own wrangler.toml, but need to duplicate my D1 schema in both and I think they would have different local DBs when running locally. Hoping there's a better way to have everything together. 🤞
Hello, I’m Allie!
You can use —persist-to so they point to the same directory when storing data Then db instances will be shared
ccostes
ccostes4mo ago
Ah perfect, thanks!
Mayuresh Choudhary
hey hello, i am facing "ERR_RUNTIME_FAILURE": MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. when i execute the "npm run dev" command in my Cloudflare web app - I created this app using "npm create-cloudflare" (v 2.21.9), wrangler (3.62.0) - web app - framework Honojs - no git, no deploy now when I execute the command "npm run dev" it the gives above error and the development server won't start i tried executing "wrangler dev" directly (with version < 3.62.0) it runs the application but i don't know whats wrong with create-cloudflare
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
oof2win2
oof2win24mo ago
so i tried using cf wrangler + devtools to profile my js but i only get (program) as the profiled code and it runs for the whole duration so it's not very useful and it happens also when using chrome://inspect and connecting using the new Performance tab (though i had to pass the --inspect flag to wrangler to make it connect properly) and when i use the example from the web it just gives (program) as well
RazzleD
RazzleD4mo ago
#wrangler help . Am I up to date with all
Kimitri
Kimitri4mo ago
the same happened to me Someone can answer me this question? did wrangler needs certification ssl to work locally?
Hello, I’m Allie!
For ingress?
Kimitri
Kimitri4mo ago
no, I'm trying to run wrangler locally and it's getting an error, I just did exactly like the documentation says to start a project "npm create hono@latest" but when I run "npm run dev" I get this error MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above. from this my-app\node_modules\wrangler\wrangler-dist\cli.js:29747 throw a; ^ and searching on google and in this community I found may be the wrangler needs certification to run locally
ccostes
ccostes4mo ago
Also unable to run pages (remix framework created with create-cloudflare) with wrangler locally (not sure why it thinks the address in use - it's not)
⛅️ wrangler 3.62.0
-------------------

✨ Compiled Worker successfully
✘ [ERROR] Address already in use (127.0.0.1:8788). Please check that you are not already running a server on this address or specify a different port with --port.

[wrangler:inf] Ready on http://localhost:53635
⎔ Starting local server...
/Users/ccostes/dev/onecall-cloudflare/frontend/node_modules/wrangler/wrangler-dist/cli.js:29747
throw a;
^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
at #assembleAndUpdateConfig (/Users/ccostes/dev/onecall-cloudflare/frontend/node_modules/miniflare/dist/src/index.js:9161:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Mutex.runWith (/Users/ccostes/dev/onecall-cloudflare/frontend/node_modules/miniflare/dist/src/index.js:3521:16) {
code: 'ERR_RUNTIME_FAILURE',
cause: undefined
}

Node.js v21.5.0
⛅️ wrangler 3.62.0
-------------------

✨ Compiled Worker successfully
✘ [ERROR] Address already in use (127.0.0.1:8788). Please check that you are not already running a server on this address or specify a different port with --port.

[wrangler:inf] Ready on http://localhost:53635
⎔ Starting local server...
/Users/ccostes/dev/onecall-cloudflare/frontend/node_modules/wrangler/wrangler-dist/cli.js:29747
throw a;
^

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
at #assembleAndUpdateConfig (/Users/ccostes/dev/onecall-cloudflare/frontend/node_modules/miniflare/dist/src/index.js:9161:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Mutex.runWith (/Users/ccostes/dev/onecall-cloudflare/frontend/node_modules/miniflare/dist/src/index.js:3521:16) {
code: 'ERR_RUNTIME_FAILURE',
cause: undefined
}

Node.js v21.5.0
Hello, I’m Allie!
That sounds like something else… Did you try again?
Kimitri
Kimitri4mo ago
yes, I retry all process since run npm create hono@latest again, and still getting the error, I don't know if this happens because I choose the option to don't send metrics to cloudflare, is it forced required?
Want results from more Discord servers?
Add your server