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

missing dependency breaks app after upgrading to v8.0.0 #926

Closed
stopfstedt opened this issue May 1, 2023 · 8 comments
Closed

missing dependency breaks app after upgrading to v8.0.0 #926

stopfstedt opened this issue May 1, 2023 · 8 comments

Comments

@stopfstedt
Copy link

Hi!

After upgrading to v8.0.0 (from v7.3.0), the file upload functionality ceased to work in my application.

The browser console shows this error:

[Uncaught (in promise) Error: Could not find module tracked-built-ins imported from ember-file-upload/helpers/file-queue

adding tracked-build-ins as a explicit dependency to my package.json file appears to overcome this issue ("tracked-built-ins": "^3.1.1"), but i doubt that this additional step is intentional.

I'd appreciate if you had a look at this, thanks!!

@jelhan
Copy link
Collaborator

jelhan commented May 1, 2023

tracked-built-ins is a peer dependency since v8.0.0:

"tracked-built-ins": "^3.1.1"
Having it installed in your app is required. Sadly some package managers are not reporting missing peer dependencies early and clearly.

@jelhan jelhan closed this as completed May 1, 2023
@jrjohnson
Copy link
Contributor

@jelhan this is a thing I really don't understand about how addons are working now. Why is this a "peer" and not just a dependency? Since we consume this in an addon do we also need to make tracked-built-ins a peer of our addon so it will be forwarded to the app? Just to be clear I'm fine with this solution to the bug, but I'd really like to understand what the right way to do this stuff is now and I'm not sure where I could even get that info 😢

@gilest
Copy link
Collaborator

gilest commented May 1, 2023

@jrjohnson I'm not certain either. #917 is where we moved those dependencies to peerDeps. I made the assumption that all ember-cli blueprint packages would be reasonable peerDeps... But perhaps not.

At least I think I'll need to add an upgrading guide... But you could make a reasonable argument for tracked-built-ins being a regular dependency.

Interested in your thoughts.

@jrjohnson
Copy link
Contributor

I didn't realize that tracked-built-ins was now in the default blueprint, I guess we haven't caught up to the latest ember-cli. I agree this seems ok to me. I still have a lot of questions about how these work, but reading through those PRs it looks like we all do! I wonder if we should have a "hey how to dependencies work now" meetup at EmberConf or something?

@gilest
Copy link
Collaborator

gilest commented May 2, 2023

One reference you could check @jrjohnson is the v2 package format RFC

This means that many things addons will try to access from their surrounding environment will need to be listed as peerDependencies. For example, addons that want to import ember-data should list ember-data as a peerDependency, so the app can control the ember-data version and the addon is guaranteed to resolve the same copy.

This also applies recursively -- if your addon wants to use an addon that needs ember-data, your addon should also list ember-data as a peerDependency. The clearest documented description of how recursive peerDependencies should work is in the Yarn PnP Formal Guarantees.

Hopefully this is helpful to you

@gilest
Copy link
Collaborator

gilest commented May 7, 2023

@stopfstedt @jrjohnson any thoughts on the proposed documentation in #928?

gilest added a commit that referenced this issue May 7, 2023
Documentation for #917 which I probably should have included before release 😅

Should help clarify the upgrade path for cases such as #926 as well as new installations
@gilest
Copy link
Collaborator

gilest commented May 7, 2023

Proposed documentation has been released. The v8 upgrade guide is now linked from the changelog and GH releases.

@stopfstedt
Copy link
Author

@stopfstedt @jrjohnson any thoughts on the proposed documentation in #928?

@gilest - thanks for the upgrade guide. adding tracked-build-ins as dev-dependency fixes this issue for us.

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