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

V1 addon (TypeScript) with app/components/some-component.ts fails to find the component #1857

Open
raido opened this issue Mar 27, 2024 · 3 comments

Comments

@raido
Copy link

raido commented Mar 27, 2024

V1 addon with structure like this:

addon/components
   some-component.ts
   some-component.hbs
app/components
  some-component.ts // which just re-exports addon/components with absolute path (package-name/addon/...);

Fails to build (embroider-safe, embroider-optimized scenarios) with errror:

Attempted to resolve 'some-component', which was expected to be a component, but nothing was found.

Workaround

Renaming app/components/some-component.ts -> app/components/some-component.js and the build succeeds.

Context

@embroider/core 2.1.1 
@embroider/webpack 2.1.1 
@embroider/compat 2.1.1
webpack 5.91.0
ember-source ~4.12.0

// ember-cli-build.js

const app = new EmberAddon(defaults, {
    "ember-cli-babel": {
      enableTypeScriptTransform: true,
    },
}
@raido raido changed the title V1 addon with app/components/some-component.ts fails to find the component V1 addon (TypeScript) with app/components/some-component.ts fails to find the component Mar 27, 2024
@NullVoxPopuli
Copy link
Collaborator

NullVoxPopuli commented Mar 27, 2024

in your addon, do you have:

options: {
  'ember-cli-babel': {
    enableTypeScriptTransform: true
  }
}

?

https://github.com/emberjs/ember-cli-babel?tab=readme-ov-file#enabling-typescript-transpilation

@raido
Copy link
Author

raido commented Apr 1, 2024

Yes, I do. The whole context up 🔝 is from the addon perspective.

@raido
Copy link
Author

raido commented Apr 16, 2024

Any updates here?

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

2 participants