benefitcloud / ember-uploader

An Ember library for uploading files
MIT License
345 stars 97 forks source link

Ember 2.16/2.17 compatibility #166

Closed pcambra closed 6 years ago

pcambra commented 6 years ago

I'm upgrading an app that relies on ember-uploader to 2.17, and I think there's something in the way that needs to be altered to make them compatible (version 1.2.3 points to "ember-cli": "2.5.0").

There are some babel transpiling issues regarding the lib/version.js file that throw this error:

www/ember-uploader/node_modules/ember-cli-babel/index.js: Property callee of CallExpression expected node to be of a type ["Expression"] but instead got null

This is my babel config:

    babel: {
      // enable "loose" mode
      loose: true,
      // don't transpile generator functions
      exclude: [
        'transform-regenerator',
      ],
      plugins: [
        'transform-object-rest-spread',
      ],
      sourceMaps: false
    }

I think this might be due the member access of the version of package.json, but I'm not really sure why this version file is needed in the first place.

If I hardcode the version and the treeForAddon method in index.js, then I get the following error:

Uncaught Error: Could not find module `ember` imported from `ember-uploader/index

I've seen adding this in ember-cli-build has been suggested in other (older) issues as a fix:

app.import('bower_components/ember-uploader/dist/ember-uploader.min.js');

But as this is not a cli/bower component anymore, I obviously get the following error:

ENOENT: no such file or directory, open '/app/tmp/source_map_concat-input_base_path-JXq0S8Hi.tmp/bower_components/ember-uploader/dist/ember-uploader.min.js'

Looking into other packages that might have similar issues, found https://github.com/thefrontside/ember-let/issues/36 that suggests to force the package to load after ember-cli-shims in the ember-addon part of the package.json file.

"after": "ember-cli-shims"

But that stills causes the same Could not find moduleemberimported fromember-uploader/index` error.

Is there any upgrade path/plans to make this addon compatible with the latest Ember versions?

snewcomer commented 6 years ago

@pcambra Could you test this against 1.3 if you don't mind? Feel free to close if it is fixed.

pcambra commented 6 years ago

Sorry, I've since moved to ember-file-upload, I guess we can close