mainmatter / ember-cli-pixijs

An Ember CLI Addon that wraps pixi.js
MIT License
12 stars 11 forks source link

Missing module error on Ember, EmberCLI 3.5.0 #83

Closed lrdiv closed 6 years ago

lrdiv commented 6 years ago

I created a component using the code from this repo's README and I am getting this error in the console:

Uncaught Error: Could not find module `ember` imported from `ember-cli-pixijs/components/pixi-canvas`

Here is my component code:

import PIXI from "pixi";
import PixiCanvas from "ember-cli-pixijs/components/pixi-canvas";

export default PixiCanvas.extend({
  draw() {
    const renderer = this.get('pixiRenderer');
    const stage = new PIXI.Container();
    const graphics = new PIXI.Graphics();

    graphics.beginFill(0xFF3300);
    graphics.lineStyle(10, 0xffd900, 1);

    graphics.moveTo(50, 50);
    graphics.lineTo(250, 50);
    graphics.lineTo(100, 100);
    graphics.lineTo(250, 220);
    graphics.lineTo(50, 220);
    graphics.lineTo(50, 50);
    graphics.endFill();

    stage.addChild(graphics);
    renderer.render(stage);
  }
});

Contents of package.json:

{
  "name": "pixi-app",
  "version": "0.0.0",
  "private": true,
  "description": "Small description goes here",
  "repository": "",
  "license": "MIT",
  "author": "",
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "build": "ember build",
    "lint:hbs": "ember-template-lint .",
    "lint:js": "eslint .",
    "start": "ember serve",
    "test": "ember test"
  },
  "devDependencies": {
    "@ember/jquery": "^0.5.2",
    "@ember/optional-features": "^0.6.3",
    "active-model-adapter": "^2.2.0",
    "bootstrap": "^4.1.3",
    "broccoli-asset-rev": "^2.7.0",
    "ember-ajax": "^3.1.0",
    "ember-auto-import": "^1.2.13",
    "ember-bootstrap": "^2.1.2",
    "ember-cli": "~3.5.0",
    "ember-cli-app-version": "^3.2.0",
    "ember-cli-babel": "^6.16.0",
    "ember-cli-dependency-checker": "^3.0.0",
    "ember-cli-dotenv": "^2.2.1",
    "ember-cli-eslint": "^4.2.3",
    "ember-cli-flash": "^1.6.6",
    "ember-cli-htmlbars": "^3.0.0",
    "ember-cli-htmlbars-inline-precompile": "^1.0.3",
    "ember-cli-inject-live-reload": "^1.8.2",
    "ember-cli-mirage": "^0.4.9",
    "ember-cli-moment-shim": "^3.7.1",
    "ember-cli-pixijs": "0.0.2",
    "ember-cli-sass": "^8.0.1",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-template-lint": "^1.0.0-beta.1",
    "ember-cli-uglify": "^2.1.0",
    "ember-data": "~3.4.0",
    "ember-data-has-many-query": "^0.2.0",
    "ember-export-application-global": "^2.0.0",
    "ember-get-config": "^0.2.4",
    "ember-kohactivated": "0.0.2",
    "ember-load-initializers": "^1.1.0",
    "ember-lodash": "^4.18.0",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-moment": "^7.8.0",
    "ember-qunit": "^3.4.1",
    "ember-resolver": "^5.0.1",
    "ember-simple-auth": "^1.7.0",
    "ember-source": "~3.5.0",
    "ember-truth-helpers": "^2.1.0",
    "eslint-plugin-ember": "^5.2.0",
    "loader.js": "^4.7.0",
    "qunit-dom": "^0.8.0",
    "sass": "^1.14.2"
  },
  "engines": {
    "node": "6.* || 8.* || >= 10.*"
  }
}
lrdiv commented 6 years ago

I just realized that the master branch seems to have resolved this issue. I will update my package.json accordingly. Thanks for your work on this addon!

milobroerse commented 5 years ago

I also had to install the master branch to get by this error. Can this be released as a new version?