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

[5.3.7] when using ember-cli-mirage ember-inflector must be a installed, otherwise production build is broken #9501

Closed
mkszepp opened this issue Jun 21, 2024 · 2 comments
Labels
upstream Upstream Dependency Fix Required

Comments

@mkszepp
Copy link
Contributor

mkszepp commented Jun 21, 2024

While updating packages in ember-power-select docs i'm running into this error in production build.

grafik

When running ember test or ember s the error is not present, but ember s -prod or also ember build -prod are generating a broken build (error in browser).

We don't use any inflector rule, for this reason we also don't get deprecation warning while ember s.

Steps

  1. Clone ember-power-select
  2. Remove package ember-inflector from docs/package.json
  3. pnpm i
  4. cd docs
  5. ember s -prod

Workaround

Add ember-inflector to package.json

@runspired
Copy link
Contributor

you'll want to run pnpm why -r ember-inflector to figure out why it was available even when not ostensibly installed. It's likely another dependency is bringing it in a way that makes it visible to node resolution but not included in the app assets

@runspired
Copy link
Contributor

I looked at the pnpm lockfile in power-select for the commit prior to you adding ember-inflector in as a dependency. The problem is that ember-inflector is installed by mirage, but then the addon deactivates itself in production. Deactivated addons won't have their dependent addons included in the build; however, they are still installed and so still visible to embroider/macros (cc @mansona @NullVoxPopuli and @ef4 who probably already know this nuance but just to surface an odd edge case with classic+macros)

I'd argue that the correct thing here is for power-select to do exactly as it did and put ember-inflector in its dev-deps.

You can see mirage is what brings the library here: https://github.com/cibernox/ember-power-select/blob/734c21825204f45dc7f7aca776d3e4abfcffaba3/pnpm-lock.yaml#L7452

@runspired runspired changed the title [5.3.7] ember-inflector must be a installed, otherwise production build is broken [5.3.7] when using ember-cli-mirage ember-inflector must be a installed, otherwise production build is broken Jun 21, 2024
@runspired runspired added the upstream Upstream Dependency Fix Required label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Upstream Dependency Fix Required
Projects
Archived in project
Development

No branches or pull requests

2 participants