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

AMD import using factory object rather than function #151

Closed
mrloop opened this issue Nov 20, 2018 · 4 comments
Closed

AMD import using factory object rather than function #151

mrloop opened this issue Nov 20, 2018 · 4 comments

Comments

@mrloop
Copy link

mrloop commented Nov 20, 2018

Closing ember-cli/ember-cli#8076 in favor of this issue, more appropriate location.

A minimal example project is available here https://github.com/mrloop/ember-cli-amd/
The relevent commit is mrloop/ember-cli-amd@37d22c6

app.import('node_modules/qz-tray/qz-tray.js', {
  using: [{ transformation: 'amd', as: 'qz-tray' }],
});

breaks with the following error:


    TypeError: this.callback.apply is not a function[Learn More]

    Module.prototype.exports  loader.js:106
    Module.prototype._reify   loader.js:143
    Module.prototype.reify    loader.js:130
    Module.prototype.exports  loader.js:104
    requireModule             loader.js:27
    <anonymous>               app-boot.js:3

This is due to qz-tray using a factory object not a function https://github.com/qzind/tray/blob/2.1/js/qz-tray.js#L1945
Looking at https://github.com/amdjs/amdjs-api/blob/master/AMD.md#factory- the factory can be a function or object.

@Glarregle
Copy link

@mrloop did you find a solution for this?

@mrloop
Copy link
Author

mrloop commented Apr 22, 2022

Yes, unfortunately I am no longer working on the project using this and it's closed source. I think in the end didn't need the extra config in ember-cli-build.js, can't remember if this was an update to ember-auto-import or what resolved issue, think it should just work now. I'll close this issue as I think its fixed (please reopen if not)

@mrloop mrloop closed this as completed Apr 22, 2022
@Rajkiran0147
Copy link

I am trying the addon single-spa-ember and I am facing the same issue when adding this in ember-cli-buid.js file.

  app.import('node_modules/single-spa-ember/amd/single-spa-ember.js', {
    using: [
      { transformation: 'amd', as: 'single-spa-ember' }
    ]
  });

Screenshot 2023-02-06 at 5 13 31 PM

@poplevente
Copy link

@Rajkiran0147 did you find any solution to this?

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

4 participants