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

[Bug] Cloudflare Pages 部署 Function 过大 #5178

Closed
GenshinMinecraft opened this issue Aug 3, 2024 · 5 comments
Closed

[Bug] Cloudflare Pages 部署 Function 过大 #5178

GenshinMinecraft opened this issue Aug 3, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@GenshinMinecraft
Copy link

📦 Deployment Method

Other

📌 Version

Latest

💻 Operating System

Other

📌 System Version

Latest

🌐 Browser

Chrome

📌 Browser Version

v126

🐛 Bug Description

在 Cloudflare Pages 部署中,可以正常编译,无法正常上传

Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large)

📷 Recurrence Steps

按照 docs 目录下的 Cloudflare Pages 教程部署

🚦 Expected Behavior

正常部署

📝 Additional Information

No response

@GenshinMinecraft GenshinMinecraft added the bug Something isn't working label Aug 3, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] Cloudflare Pages deployment Function is too large

@lloydzhou
Copy link
Contributor

error log detail:

11:51:43.289	Found _worker.js in output directory. Uploading.
11:51:44.310	Attaching additional modules:
11:51:44.329	┌────────────────────────────────────────────────────────────────────────┬──────┬────────────┐
11:51:44.330	│ Name                                                                   │ Type │ Size       │
11:51:44.330	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.330	│ __next-on-pages-dist__/cache/adaptor.js                                │ esm  │ 2.29 KiB   │
11:51:44.330	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.330	│ __next-on-pages-dist__/cache/cache-api.js                              │ esm  │ 0.43 KiB   │
11:51:44.331	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.331	│ __next-on-pages-dist__/cache/kv.js                                     │ esm  │ 0.35 KiB   │
11:51:44.331	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.331	│ __next-on-pages-dist__/functions/api/alibaba/[...path].func.js         │ esm  │ 230.24 KiB │
11:51:44.332	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.332	│ __next-on-pages-dist__/functions/api/anthropic/[...path].func.js       │ esm  │ 230.72 KiB │
11:51:44.332	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.332	│ __next-on-pages-dist__/functions/api/artifacts.func.js                 │ esm  │ 219.02 KiB │
11:51:44.332	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.332	│ __next-on-pages-dist__/functions/api/azure/[...path].func.js           │ esm  │ 229.35 KiB │
11:51:44.332	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.333	│ __next-on-pages-dist__/functions/api/baidu/[...path].func.js           │ esm  │ 230.47 KiB │
11:51:44.333	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.333	│ __next-on-pages-dist__/functions/api/bytedance/[...path].func.js       │ esm  │ 230.21 KiB │
11:51:44.333	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.333	│ __next-on-pages-dist__/functions/api/config.func.js                    │ esm  │ 218.27 KiB │
11:51:44.333	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.334	│ __next-on-pages-dist__/functions/api/google/[...path].func.js          │ esm  │ 230.05 KiB │
11:51:44.334	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.335	│ __next-on-pages-dist__/functions/api/moonshot/[...path].func.js        │ esm  │ 230.20 KiB │
11:51:44.336	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.336	│ __next-on-pages-dist__/functions/api/openai/[...path].func.js          │ esm  │ 229.75 KiB │
11:51:44.336	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.336	│ __next-on-pages-dist__/functions/api/stability/[...path].func.js       │ esm  │ 229.79 KiB │
11:51:44.336	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.336	│ __next-on-pages-dist__/functions/api/tencent.func.js                   │ esm  │ 232.17 KiB │
11:51:44.336	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.336	│ __next-on-pages-dist__/functions/api/upstash/[action]/[...key].func.js │ esm  │ 210.56 KiB │
11:51:44.337	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.337	│ __next-on-pages-dist__/functions/api/webdav/[...path].func.js          │ esm  │ 219.22 KiB │
11:51:44.337	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.337	│ __next-on-pages-dist__/manifest/27d10e462fba646daaa29468a0656e12.js    │ esm  │ 1.04 KiB   │
11:51:44.337	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.337	│ __next-on-pages-dist__/webpack/1480.js                                 │ esm  │ 0.23 KiB   │
11:51:44.337	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.337	│ __next-on-pages-dist__/webpack/413.js                                  │ esm  │ 0.87 KiB   │
11:51:44.337	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.337	│ __next-on-pages-dist__/webpack/465e80f4a104b9629d2a927cb032a10e.js     │ esm  │ 0.68 KiB   │
11:51:44.337	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.337	│ __next-on-pages-dist__/webpack/6718.js                                 │ esm  │ 2.20 KiB   │
11:51:44.337	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.337	│ __next-on-pages-dist__/webpack/752.js                                  │ esm  │ 0.31 KiB   │
11:51:44.337	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
11:51:44.337	│ __next-on-pages-dist__/webpack/8825cb5e824222a38732f0b18c717c75.js     │ esm  │ 7.38 KiB   │
11:51:44.338	└────────────────────────────────────────────────────────────────────────┴──────┴────────────┘
...
11:51:57.287	Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large)

@lloydzhou
Copy link
Contributor

#5190
before (1.1M):
hznqf94MvI
after (460.5k):
image

@Issues-translate-bot

This comment was marked as duplicate.

@lloydzhou
Copy link
Contributor

13:06:50.471	┌────────────────────────────────────────────────────────────────────────┬──────┬────────────┐
13:06:50.471	│ Name                                                                   │ Type │ Size       │
13:06:50.472	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.472	│ __next-on-pages-dist__/cache/adaptor.js                                │ esm  │ 2.29 KiB   │
13:06:50.472	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.472	│ __next-on-pages-dist__/cache/cache-api.js                              │ esm  │ 0.43 KiB   │
13:06:50.472	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.473	│ __next-on-pages-dist__/cache/kv.js                                     │ esm  │ 0.35 KiB   │
13:06:50.473	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.473	│ __next-on-pages-dist__/functions/api/[provider]/[...path].func.js      │ esm  │ 242.70 KiB │
13:06:50.473	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.473	│ __next-on-pages-dist__/functions/api/artifacts.func.js                 │ esm  │ 217.89 KiB │
13:06:50.473	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.473	│ __next-on-pages-dist__/functions/api/config.func.js                    │ esm  │ 217.14 KiB │
13:06:50.474	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.474	│ __next-on-pages-dist__/functions/api/tencent.func.js                   │ esm  │ 231.36 KiB │
13:06:50.474	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.474	│ __next-on-pages-dist__/functions/api/upstash/[action]/[...key].func.js │ esm  │ 209.43 KiB │
13:06:50.474	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.474	│ __next-on-pages-dist__/functions/api/webdav/[...path].func.js          │ esm  │ 218.09 KiB │
13:06:50.474	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.474	│ __next-on-pages-dist__/manifest/27d10e462fba646daaa29468a0656e12.js    │ esm  │ 1.04 KiB   │
13:06:50.474	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.475	│ __next-on-pages-dist__/webpack/465e80f4a104b9629d2a927cb032a10e.js     │ esm  │ 0.68 KiB   │
13:06:50.475	├────────────────────────────────────────────────────────────────────────┼──────┼────────────┤
13:06:50.475	│ __next-on-pages-dist__/webpack/8825cb5e824222a38732f0b18c717c75.js     │ esm  │ 7.38 KiB   │
13:06:50.475	└────────────────────────────────────────────────────────────────────────┴──────┴────────────┘
...
13:07:03.045	Success: Your site was deployed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants