lundi 11 février 2019

EmberJS 2.15.1 Could not find module `fullcalendar`

So I've recently updated my app to Ember 2.15.1 and I'm attempting to switch everything over to NPM from Bower. I have been playing around trying to get fullcalendar to cooperate, but have not had much luck (last one to switch over too). Figured it could have been a cache issue so both NPM/Bower cache and reinstalled both. Below is the error and the code for importing it.

I have import 'fullcalendar'; at the top of the calendar component.

Uncaught Error: Could not find module `fullcalendar` imported from `name/components/calendar`
    at missingModule (loader.js:247)
    at findModule (loader.js:258)
    at Module.findDeps (loader.js:168)
    at findModule (loader.js:262)
    at requireModule (loader.js:24)
    at Class._extractDefaultExport (index.js:389)
    at Class.resolveOther (index.js:109)
    at Class.superWrapper [as resolveOther] (ember-utils.js:423)
    at Class.resolve (resolver.js:164)
    at resolve (container.js:873)

When the import is removed I get a standard "fullCalendar is not a function" error. Removing/adding import $ from 'jquery'; does not change either of these. Here's the part of the code it errors out on, though removing it just moves down to the next mention of fullCalendar.

 didInsertElement: function(){
      $('.sample-calendar').fullCalendar({
        header: {
          left: '',
          center: '',
          right: 'title prev,next'
        },
        events: [],
        theme: true,
        aspectRatio: 0
      });
    },

The imports from ember-cli-build.

app.import('node_modules/fullcalendar/dist/fullcalendar.min.js');
app.import('node_modules/fullcalendar/dist/fullcalendar.min.css');
app.import('node_modules/fullcalendar/dist/plugins/gcal.min.js');

And then my package.json.

"devDependencies": {
    "broccoli-asset-rev": "^2.4.5",
    "ember-ajax": "^3.0.0",
    "ember-cli": "~2.15.1",
    "ember-cli-app-version": "^3.0.0",
    "ember-cli-babel": "^6.3.0",
    "ember-cli-datepicker": "wesm87/ember-datepicker#master",
    "ember-cli-dependency-checker": "^2.0.0",
    "ember-cli-eslint": "^4.0.0",
    "ember-cli-htmlbars": "^2.0.1",
    "ember-cli-htmlbars-inline-precompile": "^1.0.0",
    "ember-cli-inject-live-reload": "^1.4.1",
    "ember-cli-moment-shim": "~3.5.0",
    "ember-cli-qunit": "^4.0.0",
    "ember-cli-shims": "^1.1.0",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-data": "~2.15.0",
    "ember-export-application-global": "^2.0.0",
    "ember-fetch": "3.4.0",
    "ember-load-initializers": "^1.0.0",
    "ember-moment": "~7.5.0",
    "ember-resolver": "^4.0.0",
    "ember-source": "~2.15.0",
    "eslint-plugin-ember": "~4.1.2",
    "fullcalendar": "^4.0.0-alpha.4",
    "loader.js": "^4.2.3",
    "pikaday": "~1.4.0",
  },




Aucun commentaire:

Enregistrer un commentaire