Skip to content

jsPDF loading issue with EmberJS #905

@tzhbami7

Description

@tzhbami7

Hey there,

I've tried to import jsPDF into my Ember App but sadly without any success :/

Are you using the latest version of jsPDF?
"version": "1.3.2"

Steps to reproduce
I have importet jspdf.debug.js like described at https://guides.emberjs.com/v2.0.0/addons-and-dependencies/managing-dependencies/#toc_globals-provided-by-javascript-assets

app.import('bower_components/jspdf/dist/jspdf.debug.js');

What I saw
Uncaught Error: an unsupported module was defined, expected define(name, deps, module) instead got: 1 arguments to define

I've tried to extend the define() call in jspdf.debug.js but it seems that I'm doing it at the wrong place...

`

  jsPDF.API = { events: [] };
  jsPDF.version = "1.3.2 2016-09-30T20:33:17.116Z:jameshall";

  if (typeof define === 'function' && define.amd) {
      // INFO: I've added [] to the call down here
      define('jsPDF', [], function () {
          return jsPDF;
      });
  } else if (typeof module !== 'undefined' && module.exports) {
      module.exports = jsPDF;
  } else {
      global.jsPDF = jsPDF;
  }
  return jsPDF;

`

Any help would be highly appreciated.

Cheers,
Michael

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions