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

Uncaught TypeError: ember_new_computed.default.readOnly is not a function #92

Closed
pedrokost opened this issue Aug 9, 2015 · 12 comments
Closed

Comments

@pedrokost
Copy link

Using ember-cli-flash@1.3.3
Ember : 1.13.6
Ember Data : 2.0.0-beta.1
jQuery : 2.1.4

in line 14 of object.js:

queue: ember_new_computed['default'].readOnly('flashService.queue'),
@pedrokost
Copy link
Author

This "bug" was introduced in version 1.3.2. All previous versions work fine (between 1.1.4 and 1.3.1).

@pedrokost
Copy link
Author

This issue is holding my upgrade to ember 2.0. Have others been able to upgrade ember with the latest version of the addon?

@digitalcora
Copy link

I also see this error when attempting to use ember-cli-flash 1.3.4 with Ember 1.13.9. Tested with the not-yet-released 1.3.5 and still got the same error.

@poteto
Copy link
Collaborator

poteto commented Oct 15, 2015

Thanks for the report and super sorry for not following up on this earlier. I'm looking into it, hopefully @rwjblue can also chime in

@rwjblue
Copy link
Member

rwjblue commented Oct 15, 2015

@poteto - Do we have a reproduction?

@digitalcora
Copy link

I'm personally unable to reproduce the issue on a fresh-generated app using Ember-CLI 1.13.8, so it may be some interaction with the other dependencies of my app (and @pedrokost's). I haven't had time yet to investigate further, but I can confirm that downgrading to 1.3.1 also resolves the issue for me.

@rwjblue
Copy link
Member

rwjblue commented Oct 16, 2015

What is the output of npm ls ember-new-computed?

@rwjblue
Copy link
Member

rwjblue commented Oct 16, 2015

@poteto - I suspect the issue is that some other addon is including ember-new-computed@1.0.0 that is overriding the version that you are using here. 1.0.0 did not provide computed.foo macros, which would explain this issue.

Work around solution for that would be to use import computed from 'ember-new-computed'; const { computed: { readOnly } } = Ember; for the other ones, but I'd like to confirm the output of npm ls ember-new-computed above and get whatever is locked to 1.0.0 fixed.

@digitalcora
Copy link

@rwjblue Thanks for the pointer! It appears I was using an older version of ember-leaflet that was locked to 1.0.0. The current version no longer uses ember-new-computed at all, so I should probably upgrade and the issue will be resolved.

I'm not completely familiar with the workings of NPM, but shouldn't this kind of conflict raise an error at npm install time? If one package requires exactly 1.0.0, and another requires exactly 1.0.2, they can't both get what they want...

@rwjblue
Copy link
Member

rwjblue commented Oct 16, 2015

npm allows both to be installed, and the ember-cli build pipeline is geared towards preventing duplication in the build output. This leads to the "last" addon "winning" and clobbering other versions.

@rwjblue
Copy link
Member

rwjblue commented Oct 16, 2015

If we didn't do this, then you would have many versions of various deps shipped in vendor.js.

@digitalcora
Copy link

This leads to the "last" addon "winning" and clobbering other versions.

That... seems incredibly danger-prone. Given it's a situation where your app is almost guaranteed to be broken, shouldn't the build process at least warn you about it? (if not outright prevent you from building the app in such a state)

digitalcora added a commit to Vermonster/schoolbot that referenced this issue Oct 29, 2015
Included:
* ember-cli-moment upgrade now provides a service with `changeLocale` method
* ember-cli-font-awesome now requires `icon` parameter to `fa-icon` component

Not included:
* modernizr (need to generate a custom build for v3)
* ember-cli-flash (adopted-ember-addons/ember-cli-flash#92)
* ember-simple-auth (need to overhaul for 1.0 Ember-CLI addon)
* ember-cli-deploy (need to update deployment workflow for 0.5)
* ember-i18n (need to rebase custom branch on latest official version)
* ember-leaflet (need to update to official Ember-CLI addon release)
* Ember 2.x (need to update ember-simple-auth and ember-leaflet first)
digitalcora added a commit to Vermonster/schoolbot that referenced this issue Oct 30, 2015
This also allows upgrading ember-cli-flash to the latest version:
adopted-ember-addons/ember-cli-flash#92
@poteto poteto closed this as completed Nov 14, 2015
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