Error loading addon initializer in dummy app while testing beta and canary

Hi everyone,

I’m currently experiencing a weird issue with Ember beta and canary when running ember try:testall while developing an addon.

In particular, I get error messages about not being able to load an initializer inside the dummy app; release instead passes without any hiccup.


In my addon directory structure I have the following:

// ember-cli-foo/addon/initializers/foo.js

export function initialize(container, application) {
  // ...
}

export default {
  name: 'foo',
  initialize: initialize
};

And:

// ember-cli-foo/app/initializers/foo.js

export {
  default,
  initialize
} from 'ember-cli-foo/initializers/foo';

These have been created via the ember-cli v0.2.7 initializer generator: ember g initializer foo.


When running ember try:testall with the default configuration I get this error:

not ok 5 PhantomJS 2.0 - TestLoader Failures: dummy/tests/acceptance/foo-test: could not be loaded
    ---
        actual: >
            null
        message: >
            Died on test #1 	at moduleLoadFailure (http://localhost:7357/assets/test-support.js:5575:15)
            	at require (http://localhost:7357/assets/test-loader.js:31:31)
            	at loadModules (http://localhost:7357/assets/test-loader.js:21:25)
            	at load (http://localhost:7357/assets/test-loader.js:40:35)
            	at http://localhost:7357/assets/test-support.js:5584:20: Could not find module `ember-cli-foo/initializers/foo` imported from `dummy/initializers/foo`
        Log: >
    ...

And I can’t really see why… Any ideas?

Thanks

Is this generated by Ember-cli? The syntax seems off.

If I’m not mistaken, this should be the blueprint:

https://github.com/ember-cli/ember-cli/blob/master/blueprints/initializer-addon/files/__root__/__path__/__name__.js

My bad, I misread and didn’t realize you are talking about addons specifically.

Doomed to oblivion, shall I take?

Come on, people! Somebody must know the answer!

Hey @unwiredbrain I was running into this same issue (but for mixins versus initializers) and upgrading ember-cli in my addon to 1.13.8 fixed it for me. Hope that helps.

-Ron

@unwiredbrain I’m running into the same issue with addon mixins as well. On ember-cli@1.13.8. All the tests are passing in ember-try’s “default” scenario as well as in localhost:4200/tests. However ember-release, ember-beta, and ember-canary do not pass due to importing errors.

Tried SO advice in this answer: ember.js - ember-cli 0.2.1 - generated addon test cannot find mixin - Stack Overflow with same results as before. Note mixin files are not generated, by ember-cli, under app/mixins. Adding reference files there does not solve issue.

I’ll ping on Slack and see if I make any progress.

Update:

This may be a known issue with ember-cli@1.13.8 and is being investigated: https://github.com/ember-cli/ember-cli/issues/4633

I’m disabling all scenarios, except default, until this gets resolved.

1 Like