Closed NullVoxPopuli closed 1 year ago
After reverse engineering your CI setup to be able to reproduce this issue myself, it looks like you've hit a pnpm
bug.
The copy of @glint/environment-ember-loose
that's visible from your docs-app
is @glint+environment-ember-loose@0.9.7_q3dyqagzoarn5fdnpc2fuow56q
, but the copy that's visible from docs-app
's copy of @glint/environment-ember-template-imports
is @glint+environment-ember-loose@0.9.7_t5ycb63yys2yccfcq5mlxlwezm
.
Given that @glint/environment-ember-loose
is declared as a peerDependency
of @glint/environment-ember-template-imports
, it should be the same copy of the package that's visible from both places, but that's not the case — it appears that ETI is instead seeing the copy that "belongs to" your test-app
workspace instead.
Because of this, the order in which module resolution happens is impacting which copy of environment-ember-loose
your Registry
declarations get merged into. Due to implementation details within TypeScript itself, some modes (like --watch
and --build
) happen to resolve in an order where they land where you'd want, but others (like single-pass glint
and what the language server sees) wind up merging the declarations into the other copy instead.
I tested this via re-rolling my lockfile diff here, and now the type checking is passing.
So -- maybe more specifically, it seems that the lockfile doesn't invalidate as frequently as it should.
I'll bring this up with the pnpm folks. https://github.com/pnpm/pnpm/issues/5986
Repro:
glint
: https://github.com/CrowdStrike/ember-headless-table/pull/118/commits/c983e76ece8f7a396e9f61448da395ae996db60dlog output in case GH Action retention expires
``` pnpm glint shell: /usr/bin/bash -e {0} env: CI: true dist: ember-headless-table/dist PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin DeprecationWarning: 'createImportDeclaration' has been deprecated since v4.8.0. Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter. app/templates/docs.hbs:1:1 - error TS7053: Unknown name 'DocsWrapper'. If this isn't a typo, you may be missing a registry entry for this value; see the Template Registry page in the Glint documentation for more details. Element implicitly has an 'any' type because expression of type '"DocsWrapper"' can't be used to index type 'Globals'. Property 'DocsWrapper' does not exist on type 'Globals'.1
3
app/templates/application.hbs:3:1 - error TS7053: Unknown name 'App'. If this isn't a typo, you may be missing a registry entry for this value; see the Template Registry page in the Glint documentation for more details. Element implicitly has an 'any' type because expression of type '"App"' can't be used to index type 'Globals'. Property 'App' does not exist on type 'Globals'.
3
... 44 </:content>
app/templates/index.hbs:2:1 - error TS7053: Unknown name 'Hero'. If this isn't a typo, you may be missing a registry entry for this value; see the Template Registry page in the Glint documentation for more details. Element implicitly has an 'any' type because expression of type '"Hero"' can't be used to index type 'Globals'. Property 'Hero' does not exist on type 'Globals'.
2
...
app/templates/index.hbs:51:9 - error TS7053: Unknown name 'FeatureCard'. If this isn't a typo, you may be missing a registry entry for this value; see the Template Registry page in the Glint documentation for more details. Element implicitly has an 'any' type because expression of type '"FeatureCard"' can't be used to index type 'Globals'. Property 'FeatureCard' does not exist on type 'Globals'.
51 <FeatureCard @title="Toggle column visibility">
53
56 Change the order of columns.
app/templates/index.hbs:59:9 - error TS7053: Unknown name 'FeatureCard'. If this isn't a typo, you may be missing a registry entry for this value; see the Template Registry page in the Glint documentation for more details. Element implicitly has an 'any' type because expression of type '"FeatureCard"' can't be used to index type 'Globals'. Property 'FeatureCard' does not exist on type 'Globals'.
59 <FeatureCard @title="Resizable columns">
61
64 Change the order of data. Integrate with your existing sorting APIs.
app/templates/index.hbs:67:9 - error TS7053: Unknown name 'FeatureCard'. If this isn't a typo, you may be missing a registry entry for this value; see the Template Registry page in the Glint documentation for more details. Element implicitly has an 'any' type because expression of type '"FeatureCard"' can't be used to index type 'Globals'. Property 'FeatureCard' does not exist on type 'Globals'.
67 <FeatureCard @title="Sticky columns">
69