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

deprecation id: ember-string.add-packag does not go away when applying suggested fix #20377

Closed
st-h opened this issue Feb 19, 2023 · 10 comments
Closed

Comments

@st-h
Copy link
Contributor

st-h commented Feb 19, 2023

🐞 Describe the Bug

After upgrading to 4.10 I am seeing thousands of deprecation messages

DEPRECATION: Importing from `@ember/string` without having the `@ember/string` package in your project is deprecated. Please add `@ember/string` to your `package.json [deprecation id: ember-string.add-package] This will be removed in ember-source 5.0.0. See https://deprecations.emberjs.com/v4.x/#toc_ember-string-add-package for more details.
        at logDeprecationStackTrace (http://localhost:4200/assets/vendor.js:16199:21)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:16322:9)
        at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:16225:9)
        at HANDLERS.<computed> (http://localhost:4200/assets/vendor.js:16322:9)
        at invoke (http://localhost:4200/assets/vendor.js:16331:9)
        at deprecate (http://localhost:4200/assets/vendor.js:16298:28)
        at deprecateImportFromInternalString (http://localhost:4200/assets/vendor.js:27379:47)
        at Object.dasherize (http://localhost:4200/assets/vendor.js:27281:5)
        at normalizeModelName (http://localhost:4200/assets/vendor.js:78133:19)

However, I have "@ember/string": "^3.0.1" in devDependencies of my package.json.

After discussing this issue in discord, it seems that for some reason the ember implementation of the string functions is being invoked instead of the ones that are contained in @ember/string

There has been a comment, describing similar behaviour in another issue: emberjs/ember-string#235 (comment)
In my case I am seeing this issue in the browser, but not on the fastboot server

I have also opened an issue over at @ember/string: emberjs/ember-string#370

However, it seems that it would also be necessary to fix the misleading deprecation message

🔬 Minimal Reproduction

Describe steps to reproduce. If possible, please, share a link with a minimal reproduction.

😕 Actual Behavior

Thousands of deprecation warnings are printed

🤔 Expected Behavior

When the fix described in the deprecation message is applied, thousands of deprecation warning would no longer be printed

🌍 Environment

  • Ember: 4.10
  • Node.js/npm: -
  • OS: -
  • Browser: -

➕ Additional Context

Add any other context about the problem here.

@boris-petrov
Copy link
Contributor

Any chance you've hit this?

@st-h
Copy link
Contributor Author

st-h commented Feb 19, 2023

Any chance you've hit this?

I don't have ember-classic-decorator installed. I have ember-decorators installed though, in case that matters as well? Also, a lot of the traces seem to originate from ember data functions, so I do not think this is an issue with a single addon. There are traces from other addons as well. It looks like all of the addons call the deprecated ember string functions instead of the ones in @ember/string

@kategengler
Copy link
Member

@st-h What version of ember-data are you using? ember-data itself was not using the correct external @ember/string until this issue was resolved recently emberjs/data#8393

@st-h
Copy link
Contributor Author

st-h commented Mar 27, 2023

@st-h I am still on ember-data 4.6, because starting from 4.7 there has been a regression, which prevents me from upgrading. I'll try if it is fixed in 4.11.

However, the stack trace do not only come from ember data.

@kategengler
Copy link
Member

@st-h I mentioned in another issue you filed, but do you have ember-resolver v10.0 in your package.json? It is a version bump that would have come with the blueprint update to v4.10.

@st-h
Copy link
Contributor Author

st-h commented Mar 28, 2023

I tried with latest ember-data version, but the deprecations have not changed. I am still getting thousands of deprecations when rendering the app. Lots of deprecations originate from ember-data code. Yes, resolver is at 10.0.

Screenshot 2023-03-28 at 15 19 40

@st-h
Copy link
Contributor Author

st-h commented Mar 28, 2023

How about a pre v5.0 release which removes the deprecated ember implementations, which should resolve this issue for everyone? Others have seemingly run into similar issues where ember internal and @ember/string implementation seem to get mixed up emberjs/ember-string#235 (comment)

@kategengler
Copy link
Member

@st-h You can use 5.0 today by pointing to the alpha tag on npm or by using the canary builds. Please try it, but I suspect it will not solve your problem and it will error instead looking for @ember/string.

@st-h
Copy link
Contributor Author

st-h commented Mar 28, 2023

@kategengler As I already mentioned in emberjs/ember-string#370 it is currently not possible to try out ember 5, because there are way too many popular plugins out there that are not yet compatible with ember 5. And as it looks we lack an alternative to finally removing embers duplicate implementation, which makes the endeavour of monkey patching addons pretty much pointless.

@kategengler
Copy link
Member

Closing as this is resolved with Ember v5

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

3 participants