#[Solved] Restart computer 🤦♂ - Cloudflare Pages default dev / start errors

1 messages · Page 1 of 1 (latest)

open quail
#

Repro steps
Follow example here: https://developers.cloudflare.com/pages/framework-guides/deploy-a-remix-site/

npm create cloudflare@latest my-remix-app -- --framework=remix
cd my-remix-app
npm run dev

Which results in the following logs

$ npm run dev

> dev
> remix dev --manual -c "npm run start"


 💿  remix dev

 info  building...
 info  built (239ms)

> start
> wrangler pages dev --compatibility-date=2023-06-21 ./public

Compiling worker to "/var/folders/5k/dgqwkf8528xgw6_s5ds17d0c0000gn/T/functionsWorker-0.5623950204223702.mjs"...
✨ Compiled Worker successfully
 ⛅️ wrangler 3.1.1 (update available 3.9.0)
-----------------------------------------------------
wrangler dev now uses local mode by default, powered by 🔥 Miniflare and 👷 workerd.
To run an edge preview session for your Worker, use wrangler dev --remote
⎔ Starting local server...

▲ [WARNING] Parsed 2 valid header rules.


✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.

I've tried downgrading wrangler to v3.8.0, and to 3.1.1

Remix is a framework that is focused on fully utilizing the power of the web. Like Cloudflare Workers, it uses modern JavaScript APIs, and it places …

open quail
#

I'm able to repro with npm start as well. It looks like miniflare is not happy about something in the public/build directory

jovial sequoia
#

npx create-remix --template remix-run/remix/templates/cloudflare-pages

#

I‘ve also had issues with wrangler 3.9 so I keep it at 3.8 for now (it started but crashed after some code changes)

open quail
#

trying now

#

Hmm still the same issues (even with bumping down to 3.8 and rerunning npm install)

jovial sequoia
#

Ah, maybe a shot into the blue, but could there be another wrangler instance running on your machine?

#

Sometimes I got start up issues when I have another project running

#

You could also try increasing the compatibility date of the wrangler env. Just put the current date there (check in package.json)

open quail
open quail
#

no luck 😢

jovial sequoia
#

very strange. I'll pull your repo and try on my machine

#

that's odd, it works for me :/

#

what's your node and npm version?

#

I'm on node 18.17.1, so maybe this

open quail
#

Here's the shape of my public folder after running npm run build

jovial sequoia
#

public looks good

open quail
#

I'm on node v20.6.1 will bump down to 18.17.1, zap node_modules and try again

#

No luck with node v18.17.1

jovial sequoia
#

wow that's frustrating...

open quail
#

I think the next step for me is to verify that wrangler pages works

#

and work up from there

jovial sequoia
#

yeah that would be a good next test. also maybe plain worker

open quail
#

I'm on a 14" M2 mac. Wondering if there's an arm64 bug or something

jovial sequoia
#

I'm on a M1

#

I remember that I sometimes also had some very strange issues. Like I said, another instance running for example. Also there was one case where I had to clean the project before running (rm -rf .cache functions public) or one occasion where I even had to restart the computer

open quail
#

ooof yeah I'd hate for it to be at that level but everything's on the table at this point

jovial sequoia
#

let's see what raw pages and worker will bring. Other than these issues sometimes, cloudflare environment with remix is really nice

open quail
#

jfc 🤦‍♂️

#

ok I restarted the computer and its just working

#

@jovial sequoia thank you for talking through this with me 🎉

#

[Solved] Restart computer 🤦♂ - Cloudflare Pages default dev / start errors

#

The other issue I had was that npm run dev didn't like that I was using crypto

diff --git a/remix.config.js b/remix.config.js
index e35ffad..f0ba820 100644
--- a/remix.config.js
+++ b/remix.config.js
@@ -8,7 +8,7 @@ export default {
   serverMainFields: ["browser", "module", "main"],
   serverMinify: true,
   serverModuleFormat: "esm",
-  serverPlatform: "neutral",
+  serverPlatform: "node",
   // appDirectory: "app",
   // assetsBuildDirectory: "public/build",
   // publicPath: "/build/",

This patched that issue, but I probably need to update that for deploying

jovial sequoia
#

Happy that I could help! 😃

jovial sequoia