Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

Help needed - struggling to find/resolve a deprecation

$
0
0

I am having trouble tracking down a deprecation that’s preventing me from upgrading from 3.28 to 4.1.

I don’t see the deprecation warning when Embroider is disabled.

When I enable Embroider, I see the following warning:

[Warning] DEPRECATION: Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead. [deprecation id: ember-global] See https://deprecations.emberjs.com/v3.x/#toc_ember-global for more details. (vendor.js, line 36989)
    http://localhost:4200/assets/vendor.js:37105:17
    raiseOnDeprecation@http://localhost:4200/assets/vendor.js:36999:13
    http://localhost:4200/assets/vendor.js:37105:17
    invoke@http://localhost:4200/assets/vendor.js:37117:23
    deprecate@http://localhost:4200/assets/vendor.js:37073:28
    get@http://localhost:4200/assets/vendor.js:473:53
    eval code
    eval@[native code]
    ./node_modules/@embroider/util/ember-private-api.js@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:269:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/@embroider/util/index.js@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:280:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./helpers/ensure-safe-component.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:414:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/ember-headlessui/components/menu/item-element.hbs@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:40:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/ember-headlessui/components/menu/item-element.js@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:929:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/menu/item-element.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:249:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/ember-headlessui/components/menu/item.hbs@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:51:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/ember-headlessui/components/menu/item.js@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:940:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/menu/item.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:260:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/ember-headlessui/components/menu/items.hbs@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:62:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/ember-headlessui/components/menu/items.js@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:951:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/menu/items.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:271:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/ember-headlessui/components/menu.hbs@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:18:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./node_modules/ember-headlessui/components/menu.js@http://localhost:4200/assets/chunk.db035c1dbb051775798b.js:907:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/menu.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:227:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/page/navigation/solutions-menu.hbs@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:106:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/page/navigation/solutions-menu.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:348:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/page/navigation.hbs@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:73:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/page/navigation.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:315:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/page/header.hbs@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:51:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/page/header.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:293:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/page/index.hbs@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:62:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46
    eval code
    eval@[native code]
    ./components/page/index.js@http://localhost:4200/assets/chunk.aff63185560f92485a33.js:304:5
    __webpack_require__@http://localhost:4200/assets/chunk.b3178629548c49aae97e.js:31:46

When I run ember-try on the latest release, the first error I see is:

TypeError: Cannot read properties of undefined (reading '__loader')
                at eval (webpack://solomon-website/./node_modules/@embroider/util/ember-private-api.js?:17:26)
                at Module../node_modules/@embroider/util/ember-private-api.js (http://localhost:7357/assets/chunk.a5da01a59a0698c12dc4.js:236:1)
                at __webpack_require__ (http://localhost:7357/assets/chunk.ad013453f4fd41c7a43b.js:350:42)
                at eval (webpack://solomon-website/./node_modules/@embroider/util/index.js?:10:76)
                at Module../node_modules/@embroider/util/index.js (http://localhost:7357/assets/chunk.a5da01a59a0698c12dc4.js:247:1)
                at __webpack_require__ (http://localhost:7357/assets/chunk.ad013453f4fd41c7a43b.js:350:42)
                at eval (webpack://solomon-website/./helpers/ensure-safe-component.js?:5:86)
                at Module../helpers/ensure-safe-component.js (http://localhost:7357/assets/chunk.e40d78334092e7083666.js:414:1)
                at __webpack_require__ (http://localhost:7357/assets/chunk.ad013453f4fd41c7a43b.js:350:42)
                at eval (webpack://solomon-website/./node_modules/ember-headlessui/components/menu/item-element.hbs?:6:91)

When I search through the project, I can see several places where Ember.__loader is called. The only place I can find where Ember Global might come into play is did-update.js in @ember/render-modifiers which ember-headlessui depends on. However, that’s only targeting older versions of Ember:

const untrack = (function () {
  if (macroCondition(dependencySatisfies('ember-source', '> 3.27.0-beta.1'))) {
    // ember-source@3.27 shipped "real modules" by default, so we can just use
    // importSync to get @glimmer/validator directly
    return importSync('@glimmer/validator').untrack;
  } else if (macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-alpha.1'))) {
    // we can access `window.Ember` here because it wasn't deprecated until at least 3.27
    // eslint-disable-next-line no-undef
    return Ember.__loader.require('@glimmer/validator').untrack;
  } else {
    // nothing needed here, we do not call `untrack` in this case
  }
})();

I’m not really sure where to go next so I’m reaching out here to see if someone with more experience can help steer me towards an answer?

Thanks! :pray:t3:

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles