I’m getting this error when trying to use addon which includes asset files. Here are steps to reproduce:
$ ember addon example-addon
$ cd example-addon
$ mkdir vendor/example-addon
$ echo ‘body { background-color: #add8e6 }’ > vendor/example-addon/style.css
$ vi index.js
var path = require('path');
module.exports = {
name: 'example-addon',
included: function(app) {
this._super.included(app);
var modulePath = path.relative(app.project.root, __dirname);
app.import(path.join(modulePath, 'vendor/example-addon/style.css'));
}
};
$ ember serve // WORKS FINE
$ cd …/my-app
$ npm install --save-dev …/example-addon
$ ember serve
version: 0.1.1
Livereload server on port 35729
Serving on http://0.0.0.0:4200
Path or pattern "node_modules/example-addon/vendor/example-addon/style.css" did not match any files [string exception]
Error: Path or pattern "node_modules/example-addon/vendor/example-addon/style.css" did not match any files [string exception]
at /home/woodzu/Ember/tmp/my-app/node_modules/ember-cli/node_modules/broccoli/lib/builder.js:34:15
at $$$internal$$tryCatch (/home/woodzu/Ember/tmp/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:470:16)
at $$$internal$$invokeCallback (/home/woodzu/Ember/tmp/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:482:17)
at $$$internal$$publish (/home/woodzu/Ember/tmp/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:453:11)
at $$$internal$$publishRejection (/home/woodzu/Ember/tmp/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:395:7)
at $$rsvp$asap$$flush (/home/woodzu/Ember/tmp/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1531:9)
at process._tickCallback (node.js:419:13)
$ ls -la node_modules/example-addon/vendor/example-addon/style.css
-rw-rw-r-- 1 woodzu woodzu 35 Oct 6 21:10 node_modules/example-addon/vendor/example-addon/style.css
Getting the same issue when in index.js I declare app.import(‘vendor/example-addon/style.css’);