question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v5.7.0 to v6.0.0 migration: Assertion failed error

See original GitHub issue
  • [X ] I am on the latest ember-intl version
  • [ X] I have searched the issues of this repo and believe that this is not a duplicate

Environment

  • Ember Version: 3.28.3
  • Ember CLI Version: 3.28.3
  • Ember Intl Version: 6.0.0
  • Browser(s): Chrome 93.0
  • Node Version: 14.7.6

Steps to Reproduce

  • Update ember-intl from 5.7.0 t0 6.0.0 via npm
  • ember test
not ok 1 Chrome 93.0 - [131 ms] - Integration | Component | navbar: it renders

    ---

        stack: >

            Error: Assertion Failed: You attempted to update '_locale' on '<(unknown):ember171>', but it had already been used previously in the same computation.  Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.

            '_locale' was first used:
            
            - While rendering:
              -top-level
                application
                  index
                    navbar
                      bs-navbar
                        bs-navbar/content
                          bs-collapse
                            bs-navbar/nav
                              bs-nav/item
                                bs-navbar/link-to
                                  bs-link-to
                                    link-to
            
            Stack trace for the update:
                at dirtyTagFor (http://localhost:7357/assets/vendor.js:58515:37)
                at setter (http://localhost:7357/assets/vendor.js:58801:7)
                at _class2.set [as _locale] (http://localhost:7357/assets/vendor.js:16458:7)
                at _class2.set locale [as locale] (http://localhost:7357/assets/vendor.js:121125:22)
                at _class2.setLocale (http://localhost:7357/assets/vendor.js:121351:19)
                at new _class2 (http://localhost:7357/assets/vendor.js:121182:12)
                at Function.create (http://localhost:7357/assets/vendor.js:29497:20)
        message: >
            global failure: Error: Assertion Failed: You attempted to update `_locale` on `<(unknown):ember171>`, but it had already been used previously in the same computation.  Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
            
            `_locale` was first used:
            
            - While rendering:
              -top-level
                application
                  index
                    navbar
                      bs-navbar
                        bs-navbar/content
                          bs-collapse
                            bs-navbar/nav
                              bs-nav/item
                                bs-navbar/link-to
                                  bs-link-to
                                    link-to
            
            Stack trace for the update:
        negative: >
            false
        browser log: |
            {"type":"warn","text":"DEPRECATION: Versions of modifier manager capabilities prior to 3.22 have been deprecated. You must update to the 3.22 capabilities. [deprecation id: manager-capabilities.modifiers-3-13] See https://deprecations.emberjs.com/v3.x#toc_manager-capabilities-modifiers-3-13 for more details.\n        at logDeprecationStackTrace (http://localhost:7357/assets/vendor.js:36565:21)\n        at HANDLERS.<computed> (http://localhost:7357/assets/vendor.js:36698:9)\n        at raiseOnDeprecation (http://localhost:7357/assets/vendor.js:36592:9)\n        at HANDLERS.<computed> (http://localhost:7357/assets/vendor.js:36698:9)\n        at http://localhost:7357/assets/test-support.js:6638:10\n        at HANDLERS.<computed> (http://localhost:7357/assets/vendor.js:36698:9)\n        at invoke (http://localhost:7357/assets/vendor.js:36710:9)\n        at deprecate (http://localhost:7357/assets/vendor.js:36666:28)\n        at modifierCapabilities$1 (http://localhost:7357/assets/vendor.js:11683:62)"}
            {"type":"error","text":"\n\nError occurred:\n\n- While rendering:\n  -top-level\n    application\n      index\n        navbar\n          bs-navbar\n            bs-navbar/content\n              bs-collapse\n                bs-navbar/nav\n                  bs-nav/item\n                    bs-navbar/link-to\n                      bs-link-to\n                        link-to\n\n"}
            {"type":"error","text":"\n\nError occurred:\n\n\n\n"}
    ...

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
charlesfriescommented, Nov 6, 2021

Figured it out. We need to call setLocale before any t helpers in templates are invoked to prevent the double mutation, a good place is probably the ApplicationRoute constructor. This is still probably an issue that needs resolving, though.

import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class ApplicationRoute extends Route {
  @service intl;

  constructor() {
    super(...arguments);

    this.intl.setLocale('en-us');
  }
}
3reactions
xomaczarcommented, Nov 9, 2021

I am also seeing this failure but only in tests. Adding setupIntl(hooks) to a given test module resolves the issue for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

qemu-kvm assertion on migration at bdrv_inactivate_recurse
c:5895: bdrv_inactivate_recurse: Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed. I want to explain that twice migrate about offline ...
Read more >
Assertion Failed | Apple Developer Forums
1, attemptimng to access a web service, via NSURLSession, throws the following error;. Assertion failed: (!_inResponseAssociatedRequest), function readResponse, ...
Read more >
Release notes for the Microsoft JDBC Driver for SQL Server
This article lists the releases of the Microsoft JDBC Driver for SQL Server. For each release version, the changes are named and described....
Read more >
Migration Guide | Cypress Documentation
However, in Cypress 12, this test fails because the alias is always ... The .should() assertion now throws an error if Cypress commands...
Read more >
Releases - Fluent Assertions
Fixed For / Exclude not excluding properties in objects in a collection - #1953 ... Added difference to numeric assertion failure messages -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found