Commit 23bccdb
fix(component): drop view from mixin attribute to load on Lucee 7 (#2)
Lucee 7 enforces native trait composition on the `component mixin="..."`
attribute — it tries to load each comma-separated value as a CFML
component path at compile time. The previous declaration
component mixin="controller,view" output="false"
asks Lucee to load `view.cfc` as a trait. There is no `view.cfc` on the
component path (Wheels has no `view` mixin target — view helpers go
into `controller` mixins because views render in the controller's
variables scope). The missing trait makes the whole component fail to
compile.
The error surfaces with a misleading message:
invalid component definition, can't find component
[vendor.wheels-basecoat.Basecoat]
…which points at the OUTER component (Basecoat) rather than the
unresolved trait (view), making the actual cause hard to find. I spent
hours assuming the package directory's hyphen was the issue before
isolating this.
Net effect on Lucee 7: every `wheels packages add wheels-basecoat`
install resulted in a successful extract but no helper activation. The
package showed up in `application.wheels.failedPackages` rather than
`application.wheels.mixins`. `#uiButton(...)#`, `#uiCard(...)#`, etc.
all failed with `function UIBUTTON not found`.
Fix: drop `view` from the mixin attribute, leaving `mixin="controller"`.
The package's `package.json` already declares `provides.mixins:
"controller"` correctly — that's the actual source of truth for the
framework's PackageLoader. The component-level attribute is a
historical convention that's now obsolete.
Verified end-to-end on a fresh VM running 4.0.0-SNAPSHOT+1644 with
the matching framework fixes (wheels-dev/wheels#2373 + #2374) patched in:
Before:
$ wheels packages add wheels-basecoat
Installed wheels-basecoat@1.0.1
$ wheels stop && wheels start
$ curl localhost:8080/main/index # view calls #uiButton(...)#
ERROR: No matching function [UIBUTTON] found
After (with this fix):
$ ... same flow ...
<button type="button" class="btn">Save</button>
The same fix is needed in wheels-dev/wheels-hotwire (which has the
same `component mixin="controller,view"` declaration). PR for that
follows.
Lucee 5/6 may not enforce this strictly, which is why the bug went
undetected until Lucee 7 became the default in Wheels 4.0.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d469307 commit 23bccdb
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments