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

Build fails for addons that are using @embroider/macros #732

Open
jelhan opened this issue Aug 21, 2020 · 3 comments
Open

Build fails for addons that are using @embroider/macros #732

jelhan opened this issue Aug 21, 2020 · 3 comments

Comments

@jelhan
Copy link

jelhan commented Aug 21, 2020

If an addon is using @embroider/macros the build fails:

- Installing addon package

- Installing addon package
Installing packages... This might take a couple of minutes.
- Installing addon package
- npm: Installing [email protected] ...
npm: Installed [email protected]
installing ember-bootstrap
Installing for Bootstrap 4 using preprocessor none
  install package bootstrap

Installing packages... This might take a couple of minutes.
- npm: Installing bootstrap@^4.3.1 ...
npm: Installed bootstrap@^4.3.1
Configuration file could not be edited. Manually update your ember-cli-build.js to include 'ember-bootstrap': {"bootstrapVersion":4,"importBootstrapCSS":true}
Installed addon package.
- Building
[Embroider:MacrosConfig] cannot read userConfigs until MacrosConfig has been finalized.


Stack Trace and Error Report: /tmp/error.dump.67c8db1caf05113d786b2c2ccd26a6b8.log

No addon.js created

To be honest I'm not 100%ly sure if embroider build time macros are causing the issue. I'm seeing the above error message with ember-bootstrap@^4.0.0. As far as I'm aware it's the only addon using @embroider/macros. So I haven't tested with any other.

Please not that @embroider/macros are working fine in a default ember project. They do not require embroider build.

I have tested on ember-twiddle.com and canary.ember-twiddle.com. Adding { "ember-bootstrap": "4.0.0" } to the list of addons is enough to see the error.

@Gaurav0
Copy link
Contributor

Gaurav0 commented Aug 24, 2020

@jelhan You can test the build by cloning https://github.com/joostdevries/twiddle-backend and running the test-ember-version-locally.sh script. I might not be able to get to this quickly. Please ask if you have any issues.

@jelhan
Copy link
Author

jelhan commented Aug 24, 2020

Thanks a lot for sharing that information.

I was able to reproduce the bug locally by running ./test-ember-version-locally.sh 3.18.0 ember-bootstrap 4.0.0. But the stack trace is not that helpful:

ERROR Summary:

  - broccoliBuilderErrorStack: [undefined]
  - code: [undefined]
  - codeFrame: [undefined]
  - errorMessage: [Embroider:MacrosConfig] cannot read userConfigs until MacrosConfig has been finalized.
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: [Embroider:MacrosConfig] cannot read userConfigs until MacrosConfig has been finalized.
  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: Error: [Embroider:MacrosConfig] cannot read userConfigs until MacrosConfig has been finalized.
    at MacrosConfig.get userConfigs [as userConfigs] (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/@embroider/macros/src/macros-config.js:98:19)
    at Object.get userConfigs [as userConfigs] (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/@embroider/macros/src/macros-config.js:133:29)
    at _clone (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/clone/clone.js:162:31)
    at _clone (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/clone/clone.js:162:18)
    at _clone (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/clone/clone.js:162:18)
    at _clone (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/clone/clone.js:162:18)
    at clone (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/clone/clone.js:202:10)
    at Class._getAddonProvidedConfig (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/ember-cli-babel/index.js:251:19)
    at Class._getBabelOptions (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/ember-cli-babel/index.js:270:36)
    at Class.buildBabelOptions (/home/jelhan/tmp/twiddle-backend/tmp/3.18.0/node_modules/ember-cli-babel/index.js:33:17)

Will try to dig deeper into it later. Just wanted to leave this here for reference in case someone else has the time to pick it up earlier.

@jacobq
Copy link
Contributor

jacobq commented Apr 28, 2022

See also embroider-build/embroider#882
Is there a way to override low-level things like ember-cli-handlebars in a twiddle?

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

3 participants