glint icon indicating copy to clipboard operation
glint copied to clipboard

Type checking with project references errors

Open NullVoxPopuli opened this issue 9 months ago • 1 comments

root tsconfig.json:

{
  "references": [
    { "path": "./config/tsconfig.src.json" },
    { "path": "./config/tsconfig.tests.json" },
    { "path": "./config/tsconfig.docs-app.json" },
    { "path": "./config/tsconfig.typedoc.json" },
  ]
}

error:

❯ pnpm glint
languageId not found for <repo>/docs-app/templates/application.gts
!!sourceScript
<.pnpm>/@[email protected]/node_modules/@volar/typescript/lib/node/proxyCreateProg
ram.js:182
        throw new Error(message);
              ^

Error: !!sourceScript
    at assert (<.pnpm>/@[email protected]/node_modules/@volar/typescript/lib/node/
proxyCreateProgram.js:182:15)
    at options.host.getSourceFile (<.pnpm>/@[email protected]/node_modules/@volar/
typescript/lib/node/proxyCreateProgram.js:123:21)
    at findSourceFileWorker (<.pnpm>/[email protected]/node_modules/typescript/lib/tsc.js
:122806:23)
    at findSourceFile (<.pnpm>/[email protected]/node_modules/typescript/lib/tsc.js:12272
2:20)
    at <.pnpm>/[email protected]/node_modules/typescript/lib/tsc.js:122671:22
    at getSourceFileFromReferenceWorker (<.pnpm>/[email protected]/node_modules/typescrip
t/lib/tsc.js:122642:26)
    at processSourceFile (<.pnpm>/[email protected]/node_modules/typescript/lib/tsc.js:12
2669:5)
    at processRootFile (<.pnpm>/[email protected]/node_modules/typescript/lib/tsc.js:1225
00:5)
    at <.pnpm>/[email protected]/node_modules/typescript/lib/tsc.js:121241:41
    at forEach (<.pnpm>/[email protected]/node_modules/typescript/lib/tsc.js:32:22)
❯ pnpm why @glint/core
Legend: production dependency, optional only, dev only

[email protected] <repo>

devDependencies:
@glint/core 1.4.1-unstable.d17c1f1
@glint/environment-ember-loose 1.4.1-unstable.d17c1f1
└── @glint/core 1.4.1-unstable.d17c1f1 peer
@glint/environment-ember-template-imports 1.4.1-unstable.d17c1f1
├── @glint/core 1.4.1-unstable.d17c1f1 peer
└─┬ @glint/environment-ember-loose 1.4.1-unstable.d17c1f1 peer
  └── @glint/core 1.4.1-unstable.d17c1f1 peer
@glint/tsserver-plugin 1.4.1-unstable.d17c1f1
└── @glint/core 1.4.1-unstable.d17c1f1

NullVoxPopuli avatar May 11 '25 22:05 NullVoxPopuli

If I change my root tsconfig.json to this:

{
  "glint": {
    "environment": ["ember-loose", "ember-template-imports"]
  },
  "references": [
    { "path": "./config/tsconfig.src.json" },
    { "path": "./config/tsconfig.tests.json" },
    { "path": "./config/tsconfig.docs-app.json" },
    { "path": "./config/tsconfig.typedoc.json" },
  ]
}

I get different errors:

❯ pnpm glint
node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:84:7 - error TS1127: Invalid character.

84 >(f: (𝚪: Context, χ: never) => void): new () => InvokableInstance<Signature> & HasContext<Context>;
         ~~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:84:9 - error TS1005: ')' expected.

84 >(f: (𝚪: Context, χ: never) => void): new () => InvokableInstance<Signature> & HasContext<Context>;
           ~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:84:30 - error TS1144: '{' or ';' expected.

84 >(f: (𝚪: Context, χ: never) => void): new () => InvokableInstance<Signature> & HasContext<Context>;
                                ~~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:84:37 - error TS1109: Expression expected.

84 >(f: (𝚪: Context, χ: never) => void): new () => InvokableInstance<Signature> & HasContext<Context>;
                                       ~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:84:38 - error TS1128: Declaration or statement e
xpected.

84 >(f: (𝚪: Context, χ: never) => void): new () => InvokableInstance<Signature> & HasContext<Context>;
                                        ~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:84:45 - error TS1109: Expression expected.

84 >(f: (𝚪: Context, χ: never) => void): new () => InvokableInstance<Signature> & HasContext<Context>;
                                               ~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:84:47 - error TS1005: ';' expected.

84 >(f: (𝚪: Context, χ: never) => void): new () => InvokableInstance<Signature> & HasContext<Context>;
                                                 ~~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:101:10 - error TS1127: Invalid character.

101   body: (𝚪: Context, χ: never) => void
             ~~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:101:12 - error TS1005: ')' expected.

101   body: (𝚪: Context, χ: never) => void
               ~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:101:33 - error TS1144: '{' or ';' expected.

101   body: (𝚪: Context, χ: never) => void
                                    ~~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:102:1 - error TS1109: Expression expected.

102 ): abstract new () => unknown;
    ~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:102:2 - error TS1128: Declaration or statement e
xpected.

102 ): abstract new () => unknown;
     ~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:102:4 - error TS1434: Unexpected keyword or iden
tifier.

102 ): abstract new () => unknown;
       ~~~~~~~~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:102:18 - error TS1109: Expression expected.

102 ): abstract new () => unknown;
                     ~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:102:20 - error TS1005: ';' expected.

102 ): abstract new () => unknown;
                       ~~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:114:3 - error TS1127: Invalid character.

114   𝚪: Context,
      ~~

node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:114:5 - error TS1138: Parameter declaration expe
cted.

114   𝚪: Context,
        ~


Found 17 errors in the same file, starting at: node_modules/.pnpm/@[email protected]/node_modules/@glint/template/-private/dsl/emit.d.ts:8

My @glint deps:

    "@glint/core": "unstable",
    "@glint/environment-ember-loose": "unstable",
    "@glint/environment-ember-template-imports": "unstable",
    "@glint/template": "^1.5.2",

NullVoxPopuli avatar May 11 '25 22:05 NullVoxPopuli