[FR] demonstrate Next.js example with output: "standalone"
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, next.js
- 领域
- build-system, web-dev
调研方向
从 next.js/BUILD.bazel 和 next.config.js 开始,然后运行 bazel build //next.js:next,以复现涉及 standalone/node_modules/is-even 的 TreeArtifact 失败。成功使用 Bazel 构建 Next.js standalone 配置,并且其生成的构件可用于所请求的部署探索后,该示例即完成。
由索引模型根据 Issue 内容生成。
描述
Thanks for putting together the Bazel Next.js example. Next.js support with Bazel is something I have been hoping for for a while.
I haven't found an easy way to deploy the generated artifacts on Vercel though, so I have been exploring open-next as an open-source alternative. Open-next requires building the next.js app though in "standalone" mode as far as I understand and that I have not been able to get to work with Bazel.
I updated the next.config.js to
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
reactStrictMode: true,
swcMinify: true,
// https://nextjs.org/docs/messages/export-image-api
images: {
unoptimized: true,
},
};
module.exports = nextConfig;
However when running bazel build //next.js:next the build fails with
Starting local Bazel server and connecting to it...
INFO: Analyzed target //next.js:next (194 packages loaded, 4178 targets configured).
ERROR: /home/chris/repos/examples/frontend/next.js/BUILD.bazel:21:5: Error while validating output TreeArtifact File:[[<execution_root>]bazel-out/k8-fastbuild/bin]next.js/.next : Failed to resolve relative path standalone/node_modules/is-even inside TreeArtifact /home/chris/.cache/bazel/_bazel_chris/6124436b433d4245c5b38797a7e77c15/execroot/_main/bazel-out/k8-fastbuild/bin/next.js/.next. The associated file is either missing or is an invalid symlink.
ERROR: /home/chris/repos/examples/frontend/next.js/BUILD.bazel:21:5: JsRunBinary next.js/.next failed: not all outputs were created or valid
Target //next.js:next failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 10.898s, Critical Path: 6.68s
INFO: 29 processes: 4 internal, 1 linux-sandbox, 24 local.
ERROR: Build did NOT complete successfully
Can someone point me in the right direction here?
Has anyone found an alternative way to deploy the bazel generated artifacts to either Vecel, AWS or GCP?
Thanks,
Cheers
- 主要语言
- Starlark
- 星标
- 958
- 派生
- 582
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bazelbuild/examples 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 30/100
bazelbuild/examples#722 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 48/100
bazelbuild/examples#721 ·
-
[Bazel CI] ERROR: rules_rust_prost: implicit attribute defaults to @bazel_tools//tools/cpp:empty, fails single-file check (08-grpc-client-server)可能已有人在做 @deepalak56 于 45 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 64/100
bazelbuild/examples#710 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
bazelbuild/examples#650 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
bazelbuild/examples#642 ·
查看 bazelbuild/examples 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
bazelbuild/apple_support#707 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
-
out-of-date
难度 2/5 1-3 小时 新手友好度 68/100
CachyOS/CachyOS-PKGBUILDS#2232 ·
维护者通常 1 天内回复
-
blast/large refactor risk/low spend-dem
难度 2/5 1-3 小时 新手友好度 68/100
chriskelly/MusicWall#87 · 2 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
neilotoole/sq#1503 ·
维护者通常 1 天内回复