Script startup timed out. [code: 10021] on `wrangler publish`
See original GitHub issueI 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:
- Created a year ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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!
Bumping remix to
1.4.0
and settingserverBuildTarget: "cloudflare-workers"
insideremix.config.js
seems to have fixed this for me 👍