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

V1 Addons declared as peerDependencies are resolved by ember-auto-import #547

Open
runspired opened this issue Oct 23, 2022 · 1 comment

Comments

@runspired
Copy link

If declaring a v1 addon as a peer-dependency, but not installing it as a dev-dependency, ember-auto-import will attempt to resolve it during build and blows up.

Build Error (WebpackBundler)

@ember-data/adapter tried to import "@ember/string" in "-private/build-url-mixin.js" but the package was not resolvable from /Users/cthoburn/github/data/packages/adapter


Stack Trace and Error Report: /var/folders/51/51f8s9mn649fd4qbcmc998_m0000gp/T/error.dump.88a2885700fb7de831b2608368e3f54b.log

My guess is that there is some interplay here where ember-auto-import consults whether something is an addon, but since it is a peer-dep and not a dep/dev-dep ember-cli does not know the answer.

@runspired
Copy link
Author

Note, I've worked around this for now by configuring ember-auto-import to exclude all of these peer-deps from resolution

autoImport: {
          exclude: [
            '@ember/string',
            'ember-inflector',
            '@ember-data/store',
            '@ember-data/adapter',
            '@ember-data/serializer',
            '@ember-data/model',
            '@ember-data/record-data',
            '@ember-data/debug',
            '@ember-data/canary-features',
            '@ember-data/tracking',
            '@glimmer/tracking',
          ],
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants