Addon is not importing correctly


#1

I’m creating an addon with a mixin. In my consuming app, I import that mixin with import MyMixin from 'my-addon/mixins/my-mixin'; and log it out to the console, and I get this:

Clearly this isn’t the mixin. This seems to only be a problem in one of my apps. Pushing up my addon to Github and referencing that makes everything work, so I’m pretty sure it is an npm linking issue. Anyone have any ideas what might be wrong?


#2

How is the mixin module exported? Code?


#3

Just the default export. In the addon, I ran ember g mixin my-mixin, and from my consuming app, I imported it with addon-name/mixins/my-mixin. I looked at other addons and this is how it is done. The problem has to do with my consuming app, because importing the mixin in new ember apps works fine. And in my consuming app, it works fine too when I have my addon downloaded from a remote repo, as opposed to npm linking. It doesn’t work when I use npm link in one of my projects, and I am not sure why because npm link works fine in a fresh ember project. So it has to do with npm link and something not configured properly in my current project. I just don’t know what that is or why, and what to google for.