ember-auto-import icon indicating copy to clipboard operation
ember-auto-import copied to clipboard

Error building stuck on "ember-auto-import-webpack"

Open rtablada opened this issue 4 years ago • 15 comments

When updating Ember Auto Import to 2.x, we've run into errors where builds will stall on the step ember-auto-import-webpack.

I've tried updating other addons where available or even tried deleting dependencies to try and find which dependencies were causing issues or incompatibilities.

I've since pulled our package.json, yarn.lock, and ember-cli-build.js to a basic starter project and was able to recreate the stalled build in a project to rule out possible syntax errors. https://github.com/rtablada/auto-import-build-error

rtablada avatar Jan 22 '22 17:01 rtablada

After 1 by 1 going through addons from a fresh 3.20 ember app, I have narrowed things down a bit more to either ember-power-calendar, ember-power-calendar-moment, or the resolutions listed in the package.json...

rtablada avatar Jan 24 '22 18:01 rtablada

I'm seeing this same error after running ember-cli-update on this addon: https://github.com/elwayman02/ember-user-activity

Has anyone figured out the cause?

elwayman02 avatar Jun 30 '22 20:06 elwayman02

I have the reproduction for the hang but it's happening way down inside webpack and I have yet to get to a root cause.

ef4 avatar Jul 01 '22 02:07 ef4

If someone can spend more time helping on this, narrowing down the reproduction to a smaller set of addons would help.

ef4 avatar Jul 03 '22 18:07 ef4

@ef4 Have you been able to get to the root cause of it? Seems like I am also experiencing this problem now.

I was able to fix my issue by reverting back @babel/plugin-proposal-decorators from 7.20.0 to 7.19.6 but I am not sure what changes they made that broke this.

RosarioAleCali avatar Oct 31 '22 12:10 RosarioAleCali

I've been trying to recreate and debug this more as I've had tech debt cycles.

I've narrowed it down to two addons which seem to be causing issues:

  1. @sentry/ember@^6.19.7 - They've updated in 7.x but this only supports ember 4.x and we're in the 3.x LTS churn working on other deprecations
  2. ember-moment - My theory here is that there is something going on with ember-moment and ember-power-calendar-moment registering conflicting moment resolutions but I'm not 100% sure.

When removing both of these dependencies, I can get our app building (though obviously erroring on load because we heavily use ember-moment's template helpers.

I'm working on getting an updated reproduction package.json, yarn.lock, ember-cli-build.js, and app.js though it also seems like there is some flakyness that may be caused by other import paths: the last minimal reproduction I attempted did not lock during build which I suspect may be due to what imports are used in the app vs not.

rtablada avatar Oct 31 '22 14:10 rtablada

This is the repo with my reproduction (new project and pulled over our package.json, yarn.lock, and cli build)

https://github.com/rtablada/auto-import-build-error-oct-22 Note using Node 14.18.1 and yarn v1.22.17

I'm off of my tech debt cycle again, but will try to whittle down some things a bit while I can.

@ef4 I am available to try and pair or show in our actual codebase too if you have some time to try and knowledge share or debug.

rtablada avatar Oct 31 '22 14:10 rtablada

Interesting investigating that repo, I took the following steps and was able to get a build through:

  1. removed ember-power-calendar and ember-power-calendar-moment from package.json
  2. Ran yarn to install dependencies
  3. Ran yarn build (build succeeded)
  4. Checked out original package.json again (note, did not check out yarn.lock)
  5. Ran yarn
  6. Ran yarn build

The yarn diff is captured in this PR: https://github.com/rtablada/auto-import-build-error-oct-22/pull/1

Seems like maybe there's a lagging dependency chain that yarn is flaky at resolving.

I'm going to attempt to run this same set of steps on our production app to see if I can reproduce it.

rtablada avatar Oct 31 '22 15:10 rtablada

Though going through this, it seems like that diff is now failing with dependency lint and inconsistencies causing potential system to system flaky builds...

rtablada avatar Oct 31 '22 16:10 rtablada

I'm also running into this. At first it looked like an ember-cli-typescript problem, but I removed that and it's still happening for me. I'm early in the debugging process for this, but it is a stumper.

brianjgeiger avatar Mar 07 '23 15:03 brianjgeiger

Was able to resolve this in two of our apps. Not 100% sure that this will solve everyone's problem, but the errors did seem to resolve when we removed our yarn resolutions for @embroider/util and @embroider/macros. (note in the repo I had that reproduced the error I had resolutions declared: https://github.com/rtablada/auto-import-build-error-oct-22/blob/main/package.json#L133)

We had [email protected] installed which was complaining about multiple versions of those addons. However @embroider/util and @embroider/macros both are scoped to the addons they're used in so should be safe to have multiple versions across different addons. https://github.com/salsify/ember-cli-dependency-lint/pull/18

rtablada avatar Mar 07 '23 17:03 rtablada

Hmm. So far I have

  • Removed ember-cli-typescript, which was showing as hanging when I did a ps while this was happening
  • Removed anything moment related
  • Removed the yarn resolution for @embroider/macros

And none of that has worked for me. I guess I'm going to have to go through all of my dependencies now. Hrm.

brianjgeiger avatar Mar 07 '23 19:03 brianjgeiger

I spent more time on this too and didn't get to the root cause. I think the next step would be to bisect ones way through the webpack call graph to see which step in the build never ends. It's mostly in node callback style, so at each layer you're checking whether the done callback ever fires.

ef4 avatar Mar 07 '23 20:03 ef4

My knowledge of webpack is severely limited. How would one go about doing that? The information I got from ember-auto-import's "show debugging information for webpack" didn't actually give much useful information.

brianjgeiger avatar Mar 07 '23 20:03 brianjgeiger

Looks like for me the problem was ember-cli-release which was deprecated and we don't use it anyways. So at least it compiles now.

brianjgeiger avatar Mar 07 '23 21:03 brianjgeiger