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

placeholder "APP": Expected string substitution #194

Closed
vihai opened this issue Jan 21, 2022 · 7 comments
Closed

placeholder "APP": Expected string substitution #194

vihai opened this issue Jan 21, 2022 · 7 comments

Comments

@vihai
Copy link

vihai commented Jan 21, 2022

Hello,

After upgrading to 0.3.0 building results in:

$ ember build
Environment: development
cleaning up...
Build Error (broccoli-persistent-filter:Babel > [Babel: @embroider/macros]) in @embroider/macros/runtime.js

/home/vihai/src/kamaji-gui/@embroider/macros/runtime.js: @babel/template placeholder "APP": Expected string substitution

I am using Ember 4.1 without embroider (built with app.toTree()).
If I enable embroider (packages + compatBuild) it builds successfully.

Found this discussion:

embroider-build/embroider#1077

...but I didn't understand where the issue lies.

@jrjohnson
Copy link
Collaborator

That issue lies with any addon that has a pre 0.50 version of @embroider/macros. Many addons will need to be updated to @embroider/macros@v1. In our case that dependency comes from using ember-get-config. The best place to look for the issue is to run npm ls @embroider/macros and see what addons you have that need to be updated. I don't think there is anything that needs to be done here, but PRs welcome if I'm wrong. You're seeing this error in your app after the release here because of our dependency on ember-get-config.

@vihai
Copy link
Author

vihai commented Jan 24, 2022

Thank you very much and sorry for opening an issue that was not related to FortAwesome (I suspected that but the issue arose after updating just it). I hope this could be helpful to identify the scenario for others.

In my case the culprit is ember-power-select

@jrjohnson
Copy link
Collaborator

No worries, it's a messy issue and one I've been dealing with in our own apps all week. I'm glad you found your culprit! I'm going to close this, but feel free to re-open if it turns out there is something we need to do here.

@lcmen
Copy link

lcmen commented Mar 24, 2022

I've stumbled upon the same issue. Thank you @jrjohnson for describing details of the issue and providing npm ls command (TIL!) for tracking dependencies.

In my case the problem is caused by 2 addons:

  • ember-intl@6.0.0-beta.2 relies on @embroider/macros@0.33.0 (via ember-auto-import@1.11.3)
  • ember-cli-merage@2.4.0 relies on @embroider/macros@0.41.0

@bertdeblock
Copy link

fwiw, this addon could easily do without ember-get-config. It's only used in a component file, meaning you could just resolve the config instead. v1 of ember-get-config works significantly different than older versions and not really in a good way. It includes your config multiple times in the final build and the config you get from ember-get-config is not necessarily the same as the config an app author gets when doing import config from 'app/config/environment'.
Personally I would ditch ember-get-config here.

@jrjohnson
Copy link
Collaborator

@bertdeblock PR welcome! However getting the config from and add-on that may be consumed by other addons isn't as simple as importing it. That's the main advantage of ember-get-config, it handles the tricky part.

@bertdeblock
Copy link

bertdeblock commented Apr 22, 2022

getting the config from and add-on that may be consumed by other addons

I don't think the nesting of your addon matters if you do owner.resolveRegistration('config:environment').
I think that should always return the app's config.

Anyhow, ember-get-config v2 was just released.
At first glance, it seems to address the issues mentioned above.

EDIT: afaict, v2 still has (some of) the same issues.

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

4 participants