Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

app's TS files do not properly overwrite an addon's JS files

Open
#774 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
frontend

Research direction

Reproduce the component override using the shown my-addon/addon and my-app/app TypeScript and JavaScript files, then compare it with the working JavaScript override. Trace how the app component is resolved over the addon's component and identify why the TypeScript version fails. Done means a TypeScript app component and template can replace the addon's JavaScript component while retaining the Glint declarations.

Written by the indexing model from the issue text.

Description

I have the following example component in my addon:

my-addon/addon/components/example/index.ts

import templateOnly from '@ember/component/template-only';
export default templateOnly();
```hbs
**my-addon/addon/components/example/index.hbs**
Whatever ``` **my-addon/app/components/example/index.js** ```js export { default } from 'my-addon/components/loading'; ```

Then in my app I completely replace it with a new template AND "backing class" with some Glint because why not:
my-app/app/components/index.ts

import templateOnlyComponent from '@ember/component/template-only';

interface LoadingSignature {
  Element: HTMLElement; // <i>
}

const LoadingComponent = templateOnlyComponent<LoadingSignature>();
export default LoadingComponent;

declare module '@glint/environment-ember-loose/registry' {
  export default interface Registry {
    Loading: typeof LoadingComponent;
  }
}

my-app/app/components/index.hbs

<div>Whatever</div>

This does not work and throws the following error:
image

It does work when using a JS file to overwrite the component:
my-app/app/components/index.js

// I have lost all my Glint stuff, because it's a JS file :'(
import templateOnlyComponent from '@ember/component/template-only';
const LoadingComponent = templateOnlyComponent();
export default LoadingComponent;

my-app/app/components/index.hbs

<div>Whatever</div>
Dominant language
JavaScript
Stars
77
Forks
65
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ember-cli/ember-cli-htmlbars

All issues in ember-cli/ember-cli-htmlbars

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.