Vinext production build leaves tilde-alias SVG URLs unresolved

未关闭
#42,434 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
next.js, typescript, vite

调研方向

Start with web/app/components/datasets/documents/style.module.css and web/app/components/workflow/run/status-container.tsx, then run pnpm --dir web exec vp build with DevTools analysis disabled. Inspect emitted CSS under web/dist/client/_next/static/css/ and compare the affected document icons and workflow backgrounds in production preview, including light and dark states. Done means no unresolved ~@/ references remain while the supported Next.js build path stays compatible.

由索引模型根据 Issue 内容生成。

描述

project#dify
Self Checks
  • I have read the Contributing Guide and Language Policy.
  • This is only for bug reports; questions belong in Discussions.
  • I have searched for existing issues, including closed ones.
  • I confirm that I am using English to submit this report.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • I have filled in the required template fields.
Dify version

1.17.1 development checkout, base 06e473015a9a1abb71da88ac0a0e92d96a992008; local Vinext build with Vite+ core 0.3.2, Vinext 1.0.0-beta.10, Node 24.21.0.

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce
  1. Install the workspace dependencies and build the Vinext frontend, e.g. pnpm --dir web exec vp build with DevTools analysis disabled.
  2. Observe unresolved resource warnings for ~@/assets/*.svg and ~@/app/components/workflow/run/assets/*.svg.
  3. Inspect generated CSS under web/dist/client/_next/static/css/. The output still contains literal URLs such as url(~@/assets/pdf.svg) and url(~@/app/components/workflow/run/assets/highlight.svg).

The source patterns are also present in upstream main at the linked revision:

Example warning:

~@/assets/pdf.svg?vinext_css_url_asset=pdf.svg referenced in ~@/assets/pdf.svg?vinext_css_url_asset=pdf.svg didn't resolve at build time, it will remain unchanged to be resolved at runtime
✔️ Expected Behavior

The Vinext build resolves these assets to deployable URLs. Document icons and workflow status backgrounds should remain available in the production preview.

Acceptance criteria:

  • No unresolved ~@/ asset references remain in emitted CSS for these components.
  • Verify document-type icons and workflow status backgrounds in production preview, including light/dark states.
  • Retain compatibility with the supported Next.js build path.
❌ Actual Behavior

16 distinct SVG paths remain unresolved in the build output. The browser cannot interpret ~@/ as the project alias, so these references can request nonexistent relative resources. This report establishes the unresolved emitted URLs; a separate production-preview visual/network check should verify every affected component.

The warnings and emitted URLs occur both with and without DevTools analysis. Ordinary compilation exits successfully, so this is a resource-resolution correctness issue rather than a build crash. It was reproduced in the local development checkout described above; no claim is made that the Next.js build has the same behavior.

主要语言
TypeScript
星标
157k
派生
24.7k
平均合并
22 小时 32 分钟
30 天内合并 PR
611

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

langgenius/dify 的其他 Issue

查看 langgenius/dify 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。