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

2.2.2 breaks enums in GTS files #65

Open
Techn1x opened this issue Oct 1, 2024 · 1 comment
Open

2.2.2 breaks enums in GTS files #65

Techn1x opened this issue Oct 1, 2024 · 1 comment

Comments

@Techn1x
Copy link

Techn1x commented Oct 1, 2024

First mentioned here #38 (comment)

If an enum is defined and used in a component (within the same file)

// app/components/alert.gts
export enum AlertType {
  Information = 'information',
  Warning = 'warning',
  Critical = 'critical',
  Success = 'success',
  NewFeature = 'new-feature',
}

export component Alert: TOC = <template>
  {{#if (eq @type AlertType.Warning)}}
    ...
  {{else if ...}}
    ...
  {{/if}}
</template>

produces runtime error

Uncaught (in promise) Error: Attempted to resolve a value in a strict mode template, but that value was not in scope: AlertType

However it will work if any of these changes are made;

  • if the enum is defined in some other file and imported in
  • if the enum is set as a property in the component, and that is used in the template
@NullVoxPopuli
Copy link
Contributor

issue still present with content-tag 2.0.3 and babel-plugin-ember-template-compilation 2.3.0

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