Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files with unicode in a non-last component breaks Glint #756

Open
NullVoxPopuli opened this issue Aug 15, 2024 · 0 comments
Open

Files with unicode in a non-last component breaks Glint #756

NullVoxPopuli opened this issue Aug 15, 2024 · 0 comments

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Aug 15, 2024

in app/templates/index.gts

I import './page' (another .gts file),
and get these errors:

app/templates/index.gts:8:45 - error TS2306: File '<..>/app/templates/page.ts' is not a module.

8 import { Article, InternalLink, Link } from './page';
                                              ~~~~~~~~

app/templates/index.gts:8:45 - error TS5012: Cannot read file '<..>/app/templates/page.ts': 
  Internal error: missing location info for template.

8 import { Article, InternalLink, Link } from './page';
                                              ~~~~~~~~

A Glint internal error:

Diagnostics:
1. Glint encountered an error computing diagnostics for this file. This is likely a bug in Glint; please file an issue, including any code and/or steps to follow to reproduce the error.
   
   Error: Internal error: missing location info for template
       at findTemplateLocation (<.pnpm>/@[email protected]_@[email protected]_@glimmer_t3wvtjr7nz6nk3exr6znfvvq6u/node_modules/@glint/environment-ember-template-imports/-private/environment/transform.js:104:15)
       at transformNode (<.pnpm>/@[email protected]_@[email protected]_@glimmer_t3wvtjr7nz6nk3exr6znfvvq6u/node_modules/@glint/environment-ember-template-imports/-private/environment/transform.js:27:28)
       at visit (<.pnpm>/@[email protected]_@[email protected]_@glimmer_t3wvtjr7nz6nk3exr6znfvvq6u/node_modules/@glint/environment-ember-template-imports/-private/environment/transform.js:12:31)
       at visitNode (<.pnpm>/[email protected]/node_modules/typescript/lib/typescript.js:92459:19)
       at visitEachChildOfVariableDeclaration (<.pnpm>/[email protected]/node_modules/typescript/lib/typescript.js:93407:7)
       at Object.visitEachChild (<.pnpm>/[email protected]/node_modules/typescript/lib/typescript.js:92707:33)
       at visit (<.pnpm>/@[email protected]_@[email protected]_@glimmer_t3wvtjr7nz6nk3exr6znfvvq6u/node_modules/@glint/environment-ember-template-imports/-private/environment/transform.js:11:30)
       at visitArrayWorker (<.pnpm>/[email protected]/node_modules/typescript/lib/typescript.js:92521:49)
       at visitNodes2 (<.pnpm>/[email protected]/node_modules/typescript/lib/typescript.js:92492:19)
       at visitEachChildOfVariableDeclarationList (<.pnpm>/[email protected]/node_modules/typescript/lib/typescript.js:93413:7)

This could be due to unicode remapping from content-tag, as described here:

Which I 100% confirm via deleting a "🎉"
(or by moving the component-containing 🎉 to the end of the file).

I suspect this also needs to be fixed on main as well.

@NullVoxPopuli NullVoxPopuli changed the title Glint 1.4 can't handle importing Glint 1.4 can't handle importing a gts app/templates from app/templates/index Aug 15, 2024
@NullVoxPopuli NullVoxPopuli changed the title Glint 1.4 can't handle importing a gts app/templates from app/templates/index Files with unicode in a non-last component breaks Glint Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant