question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Script startup timed out. [code: 10021] on `wrangler publish`

See original GitHub issue

I am using @alpha (0.0.0-7d4ea43, which seems to be the only config-version working with remix/miniflare, in my local testing.)

Everything builds and runs locally, and was working up until recently, which is confusing because I locked the npm version (to prevent auto-updates which were breaking things in other ways.)

package.json

{
"private": true,
  "sideEffects": false,
  "scripts": {
    "prebuild": "node node_modules/remix-esbuild-override/dist/bin/index.js",
    "build": "remix build",
    "start:frontend": "remix watch",
    "start:backend": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' node tools/dev.mjs",
    "start": "npm run build && run-p start:*",
    "postinstall": "remix setup cloudflare-workers",
    "predeploy": "rm -rf build public/build && npm run build",
    "deploy": "wrangler publish build/index.js"
  }
}

tools/dev.mjs This is a local miniflare thing, and is working and I think unrelated to deploy:

// this is the dev-server, which uses local KV and remote DO

import { Miniflare } from "miniflare"
import { CrossKV, CrossDO } from 'cross-cf'
import fetch from 'cross-fetch'

global.fetch = fetch

const globals = {
  // ... DO and KV setup work on local
}

const mf = new Miniflare({
  envPath: true,
  packagePath: true,
  wranglerConfigPath: false,
  scriptPath: 'build/index.js',
  buildCommand: "npm run build",
  globals,
  sitePath: "./public",
  name: 'XXX',
  port: 3000,
  watch: true,
  liveReload: true,
  sourceMap: true
})

await mf.startServer()
console.log("Listening on http://localhost:3000")

wrangler.toml

name = ""

compatibility_date = "2022-01-31"
account_id = "XXX"

[build]
command = "npm run build"

[site]
bucket = "./public"

[[kv_namespaces]]
# ...

[[durable_objects.bindings]]
# ...

It builds & uploads site ok, but at end it says this:

✘ [ERROR] Received a bad response from the API

  Script startup timed out.
   [code: 10021]


  If you think this is a bug, please open an issue at:
  https://github.com/cloudflare/wrangler2/issues/new

It returns really fast (doesn’t hit 5 minute limit)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
konsumercommented, Apr 14, 2022

@threepointone cd9c418c2f482d1d4b6616d040bd48e5 is ID, but I also can’t publish, so it’s not in dash.

I am troubleshooting other issues (with not being able to override esbuid config in remix) so I can’t currently build at all, which is a whole other thing. Once I get this building, I will try out your suggestion, @MatousKundrik thanks!

1reaction
MatousKundrikcommented, Apr 14, 2022

Bumping remix to 1.4.0 and setting serverBuildTarget: "cloudflare-workers" inside remix.config.js seems to have fixed this for me 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrangler publish fails because of exceeding size while ...
This failure is due to the startup time limit of 200ms. It sounds like your code is spending more than 200ms to parse...
Read more >
Error: Something went wrong with the request to Cloudflare ...
Script startup timed out. [API code: 10021] ... I am facing below mentioned error whenever I initialize local server by running wrangler dev....
Read more >
Support Cloudflare Workers deployments of Prisma Client
Cloudflare workers limit startup-time 200 ms for uploading script. ... [API code: 10021] ❯ npx wrangler publish ✨ Built successfully, ...
Read more >
Using Cloudflare Workers and GitHub Actions to Deploy ...
We can now run wrangler publish to deploy our site to a staging environment. ❯ wrangler publish✨ Built successfully, built project size is...
Read more >
Oje - River Thames Conditions - Environment Agency - GOV.UK
Vamoose bus coupon code, Din st37-3n, Jawor grajkowska, Google translates let it go ... Isa tr84.00.07, Cam sensor out of time, Desaparecidos pelicula...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found