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

Compatibility issue of 0.94.1 with legacy packages #1692

Open
gzurbach opened this issue Jan 27, 2025 · 1 comment
Open

Compatibility issue of 0.94.1 with legacy packages #1692

gzurbach opened this issue Jan 27, 2025 · 1 comment

Comments

@gzurbach
Copy link

gzurbach commented Jan 27, 2025

Howdy!

After upgrading @glimmer/syntax from version 0.93.1 to 0.94.1, I am getting the following error when building my Ember app:

require() of ES Module /webapp/node_modules/@glimmer/syntax/dist/prod/index.js from /webapp/node_modules/ember-ast-helpers/build-time-component.js not supported.

Instead change the require of index.js in /webapp/node_modules/ember-ast-helpers/build-time-component.js to a dynamic import() which is available in all CommonJS modules.

The root cause appears to be in ember-ast-helpers, which has not been updated in 8 years. This issue impacts packages relying on ember-ast-helpers, such as ember-fontawesome. The problem is already tracked in this issue: FortAwesome/ember-fontawesome#240.

The planned solution for ember-fontawesome is to migrate to Ember Addons v2, which will remove their dependency on ember-ast-helpers. A pull request is already open (FortAwesome/ember-fontawesome#239), but it may take months to get merged.

Is there a potential workaround or fix that could be implemented in @glimmer/syntax to mitigate this issue while dependent packages, such as ember-fontawesome, update to address compatibility?

Thank you for your help!

@gzurbach gzurbach changed the title Compatibility issue of 0.94.1 with legacy packages Compatibility issue of 0.94.1 with legacy packages Jan 27, 2025
@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Jan 27, 2025

Ye, ember-fontawesome may want to pin its version of @glimmer/syntax.

While we do try to do semver, in this repo, it's a best effort sort of thing, and one thing that ve don't really want to support anymore is commonjs.

However, upcoming node versions might make things 'just work again' (supporting require of enm)

If you're wanting to fix just one project, and you use pnpm, you may use a targeted override lixe this (in package.json):

"pnpm": {
  "overrides": {
    "ember-ast-helpers>@glimmer/syntax": "0.93.1"
  }
}

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