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

Problem using this addon in an Engine Addon #15

Open
dbouwman opened this issue Mar 4, 2017 · 0 comments
Open

Problem using this addon in an Engine Addon #15

dbouwman opened this issue Mar 4, 2017 · 0 comments

Comments

@dbouwman
Copy link
Contributor

dbouwman commented Mar 4, 2017

Still looking into why this is a problem, but using the latest Engines beta, when I use this addon from within the engine (this is not an issue in a normal addon though), including it in the dependencies list in package.json, I get the following error during the build

Livereload server on http://localhost:49153
Serving on http://localhost:4200/
The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/engine-vendor.js] failed with:
Error: ENOENT: no such file or directory, open '/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/tmp/source_map_concat-input_base_path-nWYI0dJZ.tmp/undefined/sanitize.js/lib/sanitize.js'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at SourceMap.addFile (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/fast-sourcemap-concat/lib/source-map.js:75:31)
    at /Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/broccoli-concat/concat.js:200:16
    at Array.forEach (native)
    at Concat.<anonymous> (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/broccoli-concat/concat.js:198:24)
    at /Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/fast-sourcemap-concat/lib/source-map.js:393:12
    at initializePromise (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/rsvp/dist/rsvp.js:588:5)
    at new Promise (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/rsvp/dist/rsvp.js:1076:31)

The broccoli plugin was instantiated at:
    at Concat.Plugin (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/broccoli-plugin/index.js:7:31)
    at new Concat (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/broccoli-concat/concat.js:38:10)
    at module.exports (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/broccoli-concat/index.js:26:10)
    at Class.buildVendorJSWithImports (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/ember-engines/lib/engine-addon.js:149:7)
    at Class.treeForPublic (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/ember-engines/lib/engine-addon.js:436:59)
    at Class._treeFor (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/ember-cli/lib/models/addon.js:362:33)
    at Class.treeFor (/Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/ember-engines/lib/engine-addon.js:643:23)
    at /Users/dbouwman/dev/ember-bugs/arcgis-items-engine/node_modules/ember-cli/lib/broccoli/ember-app.js:522:20
    at Array.map (native)

I found a workaround by changing how the included hook in index.js works:

  included: function(app, parentAddon) {
    var current = this;
    do {
      app = current.app || app;
    } while (current.parent.parent && (current = current.parent));
    app.import(app.bowerDirectory + '/sanitize.js/lib/sanitize.js');
  }

Again - not vouching for this as the best way to solve the problem, just that this is working for me, and may be helpful to others.

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

1 participant