Netlify deploy with --no-build flag is still building edge functions
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- build-system, cli
调研方向
从 netlify deploy --no-build 路径和 Edge Functions 打包步骤开始;使用 netlify build 复现,删除 Edge Function package 的 dist 文件夹,然后执行 deploy。完成意味着 deploy 会重新使用已经构建好的 Edge Function 构件,而不会重新运行 bundler,也不要求 source 和 workspace dist 文件。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Expected behavior
According to the Netlify CLI documentation for netlify deploy:
--no-buildDo not run build command before deploying. Only use this if you have no need for a build or your project has already been built.
When running:
netlify build
successfully bundles Edge Functions and places artifacts (.netlify/edge-functions/or similar)netlify deploy --no-build
should only upload already-built assets + already-bundled Edge Functions without re-running any bundling
Observed behavior
Even with --no-build, the CLI still runs the Edge Functions bundler:
⠋ Bundling edge functions...
✘ [ERROR] Could not resolve "[REDACTED]"
[REDACTED]:
1 │ import * as mod from "[REDACTED]";
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The module "./dist/index.js" was not found on the file system:
[REDACTED]:
11 │ "default": "./dist/index.js"
╵ ~~~~~~~~~~~~~~~~~
You can mark the path "[REDACTED]" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
This fails because:
- The bundler is looking for source files and/or workspace-internal
dist/artifacts that were produced during the earliernetlify build/ monorepo build step. - Those files are not present (or not visible) in the clean GitLab CI job for the deploy stage.
- This forces us to either:
- Artifact-upload all internal
dist/folders from every workspace/package used by Edge Functions
This is very messy & results in large artifacts - Or give up on separating build & deploy and run full build again in the deploy job (loses the separation benefit)
- Artifact-upload all internal
Why this matters (business / DX impact)
- In monorepos with many packages, bundling internal
dist/folders into artifacts just to satisfy the Edge Functions bundler is inefficient and error-prone. - It defeats one of the main advertised benefits of
--no-build: clean separation of build & deploy for faster / more predictable CI, especially on large repos. - Regular (non-edge) Functions appear to respect
--no-buildmuch better (pre-zipped bundles are reused).
Steps to reproduce
- Create a new monorepo where you add a separate Edge Function in a package
- Include the Edge Function within the application
- Run
netlify build - Remove the
distfolder of the Edge Function package - Run
netlify deploy - See that it can't find the necessary files to create the Edge Function bundle
Configuration
[build]
publish = "dist" # or wherever your publish dir is
command = "turbo run build" # or similar monorepo build command
[[edge_functions]]
path = "/*"
function = "my-function"
Environment
System:
OS: macOS 15.7.3
CPU: (12) arm64 Apple M4 Pro
Memory: 196.92 MB / 24.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.22.0 - /Users/pvanmeijgaard/.local/state/fnm_multishells/11669_1770277129243/bin/node
npm: 10.9.4 - /Users/pvanmeijgaard/.local/state/fnm_multishells/11669_1770277129243/bin/npm
pnpm: 10.28.1 - /Users/pvanmeijgaard/.local/state/fnm_multishells/11669_1770277129243/bin/pnpm
bun: 1.3.7 - /opt/homebrew/bin/bun
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 480
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 66
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
netlify/cli 的其他 Issue
-
db-status.test fails if the database is disabled可能已有人在做 @paulleephp 于 3 天前认领。 未关闭type: bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
`client-ip` is not an IP address when `x-forwarded-for` holds a list or a port可能已有人在做 @Dev-next-gen 于 23 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
`netlify dev` with `--cwd` from outside the project: every function 500s with "module is not defined in ES module scope" (`detectZisiBuilder` passes a string to `readPackageUp`)可能已有人在做 @bsplatt92 于 64 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area: command: deploy area: docs type: feature
难度 1/5 1 小时以内 新手友好度 88/100
netlify/cli#1984 · 19 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
type: bug
难度 4/5 3-5 天 新手友好度 20/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
mobile-next/mobile-mcp#526 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 1/5 1 小时以内 新手友好度 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · 1 条评论 ·
维护者通常 1 天内回复