在 #38658 中,rollup 插件编译器默认启用,但是,如果插件生成的清单条目缺失或过时(例如 Chat 插件),插件可能会消失。
本次提交添加了逻辑,使用现有的清单查找路径,在开发环境中按需编译插件包,然后重试查找,从而防止像 chat 这样的插件在切换到 rollup 后在本地开发中静默加载失败。
此外,添加了一个失败的 spec 来防止回归。
之前:
即使插件已启用,开发容器中也没有任何反应。
之后:
在 #38658 中,rollup 插件编译器默认启用,但是,如果插件生成的清单条目缺失或过时(例如 Chat 插件),插件可能会消失。
本次提交添加了逻辑,使用现有的清单查找路径,在开发环境中按需编译插件包,然后重试查找,从而防止像 chat 这样的插件在切换到 rollup 后在本地开发中静默加载失败。
此外,添加了一个失败的 spec 来防止回归。
之前:
即使插件已启用,开发容器中也没有任何反应。
之后:
插件资源在开发模式下启动服务器时会自动编译。这就是您截图中日志中的“[PluginJsWatcher]”那一行。我们有意将系统设计为在后台发生编译,而不是在 Web 请求期间进行编译。
我们的团队中许多人在过去几周一直在开发中使用这个系统,所以一定是你系统中有一些特殊之处导致它失败了。![]()
您是如何启动服务器的?您设置了任何不寻常的环境变量吗?
我使用 devcontainer 启动了服务器,使用 git pull 从先前版本进行了更新,然后使用 ctrl+shift+b 启动服务器,但插件在启动时从未编译。
未设置任何环境变量。
在控制台中,你看到 [PluginJsWatcher] 行了吗?你看到类似 [Plugin::JsManager] Finished initial compilation of plugins in 5.9s 的信息了吗?
更改之前,没有。
服务器刚启动时显示 ready,但聊天没有编译。
我将上传一个录屏。
视频似乎太大了。
请尝试:删除 /app/assets/generated
控制台显示以下内容,但聊天从未编译。
Ember CLI 正在 PID: 3456 上运行
启动 CSS 更改监视器
[ember-cli] 代理到 http://127.0.0.1:3000
[ember-cli] 正在构建...
[ember-cli] ...[BroccoliMergeFiles]
I, [2026-03-20T09:47:37.703686 #3481] INFO -- : 正在监听 addr=127.0.0.1:3000 fd=38
[ember-cli] ...[ConfigLoader]
[ember-cli] ...[Babel: ember-tracked-storage-polyfill > applyPatches]
[ember-cli] ...[Babel: pretty-text > applyPatches]
I, [2026-03-20T09:47:43.338485 #3466] INFO -- : mold gen=0 pid=3481 ready
I, [2026-03-20T09:47:43.340508 #3466] INFO -- : monitor pid=3466 ready
I, [2026-03-20T09:47:43.340654 #3466] INFO -- : monitor process ready
I, [2026-03-20T09:47:43.361234 #3481] INFO -- : service gen=0 spawning...
I, [2026-03-20T09:47:44.817214 #3481] INFO -- : worker=0 gen=0 spawning...
[ember-cli] ...[Babel: @embroider/macros > applyPatches]
[ember-cli] ...[Babel: ember-this-fallback > applyPatches]
I, [2026-03-20T09:47:46.412287 #3466] INFO -- : service gen=0 pid=4278 spawned
I, [2026-03-20T09:47:46.413532 #4278] INFO -- : starting 1 supervised sidekiqs
I, [2026-03-20T09:47:46.716314 #3481] INFO -- : worker=1 gen=0 spawning...
I, [2026-03-20T09:47:48.556407 #3466] INFO -- : worker=0 gen=0 pid=4316 registered
I, [2026-03-20T09:47:48.610839 #4316] INFO -- : worker=0 gen=0 pid=4316 ready
I, [2026-03-20T09:47:48.651842 #3481] INFO -- : worker=2 gen=0 spawning...
I, [2026-03-20T09:47:50.233024 #3466] INFO -- : worker=1 gen=0 pid=4371 registered
I, [2026-03-20T09:47:50.514859 #4371] INFO -- : worker=1 gen=0 pid=4371 ready
I, [2026-03-20T09:47:50.758417 #4381] INFO -- : Loading Sidekiq in process id 4381
I, [2026-03-20T09:47:52.373478 #3466] INFO -- : worker=2 gen=0 pid=4413 registered
I, [2026-03-20T09:47:52.452613 #4413] INFO -- : worker=2 gen=0 pid=4413 ready
[ember-cli] ...[@embroider/compat/app]
writing pid file /workspace/discourse/tmp/pids/plugin_js_watcher_0.pid for 4554
I, [2026-03-20T09:47:54.484062 #4554] INFO -- : [PluginJsWatcher] Loading PluginJsWatcher in process id 4554
[ember-cli] ...[@embroider/webpack]
[Plugin::JsManager] Compiling 43 plugins...
[ember-cli] ...[@embroider/webpack]
[ember-cli] ...[@embroider/webpack]
[ember-cli] file added checklist
[ember-cli] ...[@embroider/webpack]
[ember-cli] ...[@embroider/webpack]
[ember-cli] ...[@embroider/webpack]
Finished Plugin JS watcher thread
/workspace/discourse/lib/asset_processor.rb:169:in 'MiniRacer::Context#call': terminated (MiniRacer::ScriptTerminatedError)
from /workspace/discourse/lib/asset_processor.rb:169:in 'block in AssetProcessor.v8_call'
from /workspace/discourse/lib/asset_processor.rb:168:in 'Thread::Mutex#synchronize'
from /workspace/discourse/lib/asset_processor.rb:168:in 'AssetProcessor.v8_call'
from /workspace/discourse/lib/asset_processor.rb:244:in 'AssetProcessor#rollup'
from /workspace/discourse/lib/plugin/js_compiler.rb:21:in 'Plugin::JsCompiler#compile!'
from /workspace/discourse/lib/plugin/js_manager.rb:132:in 'Plugin::JsManager#compile_js_bundle'
from /workspace/discourse/lib/plugin/js_manager.rb:57:in 'block in Plugin::JsManager#compile!'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:650:in 'Parallel.call_with_index'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:620:in 'Parallel.process_incoming_jobs'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:600:in 'block in Parallel.worker'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:591:in 'Process.fork'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:591:in 'Parallel.worker'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:582:in 'block in Parallel.create_workers'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:581:in 'Array#each'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:581:in 'Enumerable#each_with_index'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:581:in 'Parallel.create_workers'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:520:in 'Parallel.work_in_processes'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:291:in 'Parallel.map'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/parallel-1.27.0/lib/parallel.rb:235:in 'Parallel.each'
from /workspace/discourse/lib/plugin/js_manager.rb:56:in 'Plugin::JsManager#compile!'
from /workspace/discourse/lib/plugin/js_manager.rb:190:in 'Plugin::JsManager#watch'
from /workspace/discourse/lib/demon/plugin_js_watcher.rb:17:in 'Demon::PluginJsWatcher#after_fork'
from /workspace/discourse/lib/demon/base.rb:188:in 'block in Demon::Base#run'
from /workspace/discourse/lib/demon/base.rb:184:in 'Kernel#fork'
from /workspace/discourse/lib/demon/base.rb:184:in 'Demon::Base#run'
from /workspace/discourse/lib/demon/base.rb:177:in 'Demon::Base#start'
from /workspace/discourse/lib/demon/base.rb:30:in 'block in Demon::Base.start'
from 内部:257:in 'Integer#times'
from /workspace/discourse/lib/demon/base.rb:30:in 'Demon::Base.start'
from /workspace/discourse/config/pitchfork.conf.rb:126:in 'block in Pitchfork::Configurator#load'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:631:in 'Pitchfork::HttpServer#service_loop'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:680:in 'block in Pitchfork::HttpServer#spawn_service'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:1222:in 'block in Pitchfork::HttpServer#fork_sibling'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:170:in 'block in Pitchfork.clean_fork'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:168:in 'Kernel#catch'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork.rb:168:in 'Pitchfork.clean_fork'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:690:in 'Pitchfork::HttpServer#spawn_initial_mold'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:176:in 'Pitchfork::HttpServer#start'
from /home/discourse/.bundle/gems/ruby/3.4.0/gems/pitchfork-0.18.2/exe/pitchfork:110:in '<required>'
from /workspace/discourse/bin/pitchfork:58:in 'Kernel#load'
from /workspace/discourse/bin/pitchfork:58:in 'block in <main>'
from /workspace/discourse/bin/pitchfork:58:in 'Kernel#fork'
from /workspace/discourse/bin/pitchfork:58:in '<main>'
[ember-cli] ...[@embroider/webpack]
[ember-cli] ...[@embroider/webpack]
[ember-cli] ...[@embroider/webpack]
[ember-cli] ...[Babel: discourse > applyPatches]
[ember-cli]
[ember-cli] Build successful (105607ms) – Serving on http://localhost:4200/
[ember-cli]
[ember-cli] Slowest Nodes (totalTime >= 5%) | Total (avg)
[ember-cli] -+---
[ember-cli] @embroider/webpack (1) | 86394ms
[ember-cli] @embroider/compat/app (1) | 6764ms
[ember-cli] Babel: pretty-text (1) | 5364ms
[ember-cli]
[ember-cli] 正在构建...
[ember-cli] ...[@embroider/webpack]
[ember-cli]
[ember-cli] Build successful (4541ms) – Serving on http://localhost:4200/
[ember-cli]
[ember-cli] Slowest Nodes (totalTime >= 5%) | Total (avg)
[ember-cli] -+---
[ember-cli] @embroider/webpack (1) | 2508ms
[ember-cli] Funnel (179) | 1005ms (5 ms)
[ember-cli] @embroider/compat/app (1) | 415ms
[ember-cli] broccoli-persistent-filter:Mapper (3) | 353ms (117 ms)
[ember-cli]
啊,谢谢!
看起来聊天的初始编译在您的机器上超时了。我们来增加这个时间,使其在较慢的环境中运行得更好:
如果您能够在 docker 环境中提供更多 CPU/内存资源,这将改善您的开发体验。但至少增加这个时间应该能使其正常工作。