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

Wrangler Deploy Fails After Adding FrogUI #240

Closed
1 task done
earth2travis opened this issue Apr 10, 2024 · 3 comments · Fixed by #255
Closed
1 task done

Wrangler Deploy Fails After Adding FrogUI #240

earth2travis opened this issue Apr 10, 2024 · 3 comments · Fixed by #255
Assignees
Labels
P: Medium Priority: Medium T: Bug Type: Bug T: Tech Debt Type: Tech Debt

Comments

@earth2travis
Copy link
Contributor

earth2travis commented Apr 10, 2024

Describe the bug

Receiving Cloudflare error workers.api.error.script_too_large [code: 10027] after adding FrogUI

Link to Minimal Reproducible Example

TypeScript Playground

Steps To Reproduce

Trying to get 🐸 working with Cloudflare Workers

pnpm create frog -t cloudflare-worker

In index.tsx changed:

const manifest = await import('__STATIC_CONTENT_MANIFEST')
const serveStaticOptions = { manifest, root: './' }

to:

const serveStaticOptions = { root: './', manifest: {} };

Added the top level main field to workers.toml:

main = "workers-site/index.js"
pnpm wrangler deploy --minify src/index.tsx

And it successfully deployed:

Total Upload: 2334.26 KiB / gzip: 831.76 KiB

Then I added ui.tsx, imported it, and added some styles in index.tsx

import { Box, Heading, VStack, vars } from './ui.js';

Attempted to deploy the updates:

pnpm wrangler deploy --minify src/index.tsx

And it is failing with the following:

▲ [WARNING] We recommend keeping your script less than 1MiB (1024 KiB) after gzip. Exceeding this can affect cold start time. Consider using Wrangler's `--minify` option to reduce your bundle size.

▲ [WARNING] Here are the 5 largest dependencies included in your script:

- node_modules/.pnpm/[email protected][email protected]/node_modules/frog/_lib/ui/icons.js - 1841.18 KiB
- node_modules/.pnpm/[email protected]/node_modules/workers-og/dist/resvg-LFIOYO65.wasm - 1341.69 KiB
- node_modules/.pnpm/[email protected]/node_modules/workers-og/dist/index.js - 400.18 KiB
- node_modules/.pnpm/[email protected]/node_modules/workers-og/dist/yoga-ZMNYPE6Z.wasm - 86.58 KiB
- node_modules/.pnpm/@[email protected]/node_modules/@scure/bip39/esm/wordlists/korean.js - 71.91 KiB

If these are unnecessary, consider removing them

✘ [ERROR] A request to the Cloudflare API (/accounts/4e1a03d9fee3ff0defb22eb9feb2c42e/workers/scripts/frog-template) failed.

workers.api.error.script_too_large [code: 10027]
Total Upload: 4185.50 KiB / gzip: 1082.08 KiB

Frog Version

0.8.1

TypeScript Version

5.4.5

Check existing issues

Anything else?

No response

@waptik
Copy link

waptik commented Apr 14, 2024

I can confirm the existence of this bug as I'm also getting similar errors:

$ bun run wrangler:deploy
$ wrangler deploy --minify src/index.tsx
 ⛅️ wrangler 3.50.0
-------------------
Fetching list of already uploaded assets...
Building list of assets to upload...
 = icon.6207b966a9.png (already uploaded icon.png)
Skipped uploading 1 existing asset.
↗️  Done syncing assets
Total Upload: 4228.45 KiB / gzip: 1100.45 KiB
▲ [WARNING] We recommend keeping your script less than 1MiB (1024 KiB) after gzip. Exceeding this can affect cold start time. Consider using Wrangler's `--minify` option to reduce your bundle size.


▲ [WARNING] Here are the 5 largest dependencies included in your script:

  - node_modules/frog/_lib/ui/icons.js - 1841.18 KiB
  - node_modules/workers-og/dist/resvg-LFIOYO65.wasm - 1341.69 KiB
  - node_modules/workers-og/dist/index.js - 400.18 KiB
  - node_modules/workers-og/dist/yoga-ZMNYPE6Z.wasm - 86.58 KiB
  - node_modules/@scure/bip39/esm/wordlists/korean.js - 71.91 KiB
  If these are unnecessary, consider removing them



✘ [ERROR] A request to the Cloudflare API (/accounts/[REDACTED]) failed.

  workers.api.error.script_too_large [code: 10027]

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


error: script "wrangler:deploy" exited with code 1
error: script "deploy" exited with code 1

@dalechyn dalechyn self-assigned this Apr 18, 2024
@dalechyn dalechyn added P: Medium Priority: Medium T: Bug Type: Bug T: Tech Debt Type: Tech Debt labels Apr 20, 2024
@carlaiau
Copy link
Sponsor

Same here, on Cloudflare workers specifically

@zerokarafont
Copy link

upgrade workers to paid plan, max 10M size, solved my problem

@tmm tmm closed this as completed in #255 May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P: Medium Priority: Medium T: Bug Type: Bug T: Tech Debt Type: Tech Debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants