Relates to
LikeC4 Language
Version you are using
1.50.0
Describe the issue
Summary
After the introduction of the implicitViews option in LikeC4 extension v1.50, the Diagram Preview fails on larger projects with the error "View title cannot contain newlines". Setting implicitViews: false in the project config resolves the error and views build correctly. On smaller projects, implicit views work as expected.
Environment
- Extension: LikeC4 VSCode
1.50.0
- Config:
implicitViews present in schema (defaults to true when not set)
Steps to reproduce
- Use a LikeC4 project with a substantial number of elements and without setting
implicitViews (relying on default).
- Open the project in VS Code with the LikeC4 extension v1.50.
- Open Diagram Preview.
Actual behavior
-
Preview shows: "Oops, something went wrong."
-
Error message: "Request likec4/fetchComputedModel failed with message: View title cannot contain newlines."
-
Same error appears for likec4/layout-view and other requests.
-
Logs (Output → LikeC4):
request 'fetchComputedModel' of 'system' failed after 1.2s
Request likec4/fetchComputedModel failed with message: View title cannot contain newlines
Workaround
Set implicitViews: false in the project config (e.g. .likec4rc or likec4.config.json):
{
"implicitViews": false
}
After that, views build normally and the error disappears.
Project scale (affected project)
Rough counts from the project where the bug appears:
| Metric |
Count |
| LikeC4 source files |
114 |
| Elements |
526 |
| Relations |
1328 |
| Extends |
148 |
| Views |
269 |
| Deployment instances |
380 |
On a smaller project, implicit views and auto-generation work correctly.
Root cause (hypothesis)
Implicit views are generated with a title derived from element titles (Auto / ${element.title ?? fqn}). If an element’s title contains newlines (e.g. multi-line or markdown in the DSL), the generated view title contains newlines. Later, view path/title handling (e.g. in view-title-path.ts) enforces that view titles must not contain newlines and throws, breaking the computed model and layout.
Proposed change
Change the semantics of implicitViews so that auto-generated implicit views are only enabled when the option is set explicitly in the config.
- Current behaviour:
implicitViews defaults to true when omitted → implicit views are created for all elements without explicit views, which can trigger the newline error when element titles contain newlines.
- Desired behaviour: Implicit views are created only when
implicitViews is explicitly set to true in the project config. When the option is absent (or set to false), do not auto-generate implicit views.
This would:
- Avoid breaking existing large projects that rely on the previous behaviour (no implicit views) and may have multi-line element titles.
- Keep the feature available for projects that opt in with
implicitViews: true.
- Align with “enable only when explicitly configured” for a feature that can be sensitive to content (e.g. titles with newlines).
References
- Config schema:
packages/config/src/schema.ts (lines 103–107) — implicitViews optional, described as “Defaults to true”.
- Error origin:
View title cannot contain newlines is thrown from view title/path handling (e.g. packages/core view-title-path utilities).
- Related: PR #2648 — auto-generate scoped views, configurable via
implicitViews (enabled by default).
If possible, include link to the playground with example
No response
Relates to
LikeC4 Language
Version you are using
1.50.0
Describe the issue
Summary
After the introduction of the
implicitViewsoption in LikeC4 extension v1.50, the Diagram Preview fails on larger projects with the error "View title cannot contain newlines". SettingimplicitViews: falsein the project config resolves the error and views build correctly. On smaller projects, implicit views work as expected.Environment
1.50.0implicitViewspresent in schema (defaults totruewhen not set)Steps to reproduce
implicitViews(relying on default).Actual behavior
Preview shows: "Oops, something went wrong."
Error message: "Request likec4/fetchComputedModel failed with message: View title cannot contain newlines."
Same error appears for
likec4/layout-viewand other requests.Logs (Output → LikeC4):
Workaround
Set
implicitViews: falsein the project config (e.g..likec4rcorlikec4.config.json):{ "implicitViews": false }After that, views build normally and the error disappears.
Project scale (affected project)
Rough counts from the project where the bug appears:
On a smaller project, implicit views and auto-generation work correctly.
Root cause (hypothesis)
Implicit views are generated with a title derived from element titles (
Auto / ${element.title ?? fqn}). If an element’s title contains newlines (e.g. multi-line or markdown in the DSL), the generated view title contains newlines. Later, view path/title handling (e.g. inview-title-path.ts) enforces that view titles must not contain newlines and throws, breaking the computed model and layout.Proposed change
Change the semantics of
implicitViewsso that auto-generated implicit views are only enabled when the option is set explicitly in the config.implicitViewsdefaults totruewhen omitted → implicit views are created for all elements without explicit views, which can trigger the newline error when element titles contain newlines.implicitViewsis explicitly set totruein the project config. When the option is absent (or set tofalse), do not auto-generate implicit views.This would:
implicitViews: true.References
packages/config/src/schema.ts(lines 103–107) —implicitViewsoptional, described as “Defaults to true”.View title cannot contain newlinesis thrown from view title/path handling (e.g.packages/coreview-title-path utilities).implicitViews(enabled by default).If possible, include link to the playground with example
No response