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

@ember/renderer work in 2.8.0/2.8.1 not compatible with prior ember releases #1232

Open
runspired opened this issue Jul 15, 2022 · 7 comments

Comments

@runspired
Copy link
Contributor

runspired commented Jul 15, 2022

Resulting error in both 4.4 LTS and 3.28 LTS

Uncaught Error: Could not find module `@ember/renderer` imported from `(require)`
    at missingModule (loader.js:247:1)
    at findModule (loader.js:258:1)
    at requireModule (loader.js:24:1)
    at Module.callback (render-settled.js:12:1)
    at Module.exports (loader.js:106:1)
    at Module._reify (loader.js:143:1)
    at Module.reify (loader.js:130:1)
    at Module.exports (loader.js:104:1)
    at Module._reify (loader.js:143:1)
    at Module.reify (loader.js:130:1)

At a minimum this should have been a major version, but given it doesn't support either LTS likely we should fix.

@runspired
Copy link
Contributor Author

cc @cafreeman and @rwjblue. Likely the version check is trolling.

@BobrImperator
Copy link

@ember/[email protected] also breaks in ember-simple-auth for >=3.12 <3.28

@ember/test-helpers@~2.7.0 seems to work correctly.

not ok 1 Chrome 103.0 - [undefined ms] - Global error: Uncaught Error: Could not find module `@glimmer/manager` imported from `(require)` at http://localhost:7357/assets/vendor.js, line 7463
    ---
        browser log: |
            {"type":"error","text":"Uncaught Error: Could not find module `@glimmer/manager` imported from `(require)` at http://localhost:7357/assets/vendor.js, line 7463\n","testContext":{}}
    ...
not ok 2 Chrome 103.0 - [undefined ms] - Global error: Uncaught Error: The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js". at http://localhost:7357/135649072972/tests/index.html?hidepassed, line 42
    ---
        browser log: |
            {"type":"error","text":"Uncaught Error: The tests file was not loaded. Make sure your tests index.html includes \"assets/tests.js\". at http://localhost:7357/135649072972/tests/index.html?hidepassed, line 42\n","testContext":{"state":"complete"}}

@ctjhoa
Copy link

ctjhoa commented Aug 4, 2022

Same error Could not find module @glimmer/manager with tinymce-ember
concordnow/tinymce-ember#274
https://github.com/concordnow/tinymce-ember/runs/7655733728?check_suite_focus=true

This may be related to
#1220
#1221

@ro0gr
Copy link
Contributor

ro0gr commented Aug 4, 2022

Looks like this is a common issue for monorepo setups, which is caused by npm/yarn installation specifics. There is a nice explanation of the issue embroider-build/embroider#1169 (comment)

In my case, I've worked it around by switching from npm to pnpm. Also sounds like for yarn the nohoist option might help as described in the explanation from the link above.

@runspired
Copy link
Contributor Author

@ro0gr I'm not sure that's the case here. In data we don't have any competing versions to worry about yet still end up with this error.

mydea added a commit to fabscale/ember-graphql-client that referenced this issue Aug 4, 2022
@ro0gr
Copy link
Contributor

ro0gr commented Aug 4, 2022

@runspired ya, sure. I didn't have any conflicting versions declared explicitly as well.
However, in the recent versions of the test-helpers it got a peer dependency on ember-source

"peerDependencies": {
"ember-source": ">=3.8.0"
},

And seems like this causes some of package managers to install the latest possible ember-source version to the root node_modules, which in its turn makes embroider/macros's dependencySatisfies( to ignore the test-app's ember-source version, and use one from the root node_modules(like explained in the embroider thread).

You can ensure if that's the case for you by checking all the installed ember-source copies in the monorepo setup, like

npm list ember-source

or similar.

gilest added a commit to adopted-ember-addons/ember-file-upload that referenced this issue Dec 26, 2022
Temporary measure.

Don't really want to release while this dependency is pinned with a ~ as this is a declared dependency of the included test helpers.

But also uncomfortable with the CI failing for ember 3.28.

Reference:
emberjs/ember-test-helpers/issues/1232
gilest added a commit to adopted-ember-addons/ember-file-upload that referenced this issue Jan 21, 2023
Allows us to continue to test Ember 3.28 via ember try.

I've been struggling with that particular build since: emberjs/ember-test-helpers#1232

To my best understanding a quirk in yarn's (incorrect) handling of peerDependencies with monorepo causes incorrect resolution of ember-source.

I wasn't able to find a nohoist config with yarn which worked, although I'm open to suggestions.

As suggested in this comment pnpm handles peerDeps more correctly, and provides the dependenciesMeta.*.injected option.

This issue has been blocking the release of ember-file-upload because this addon includes @ember/test-helpers in its own dependencies (we ship custom test helpers which depend on that package). I don't want to cut a release with a restrictive @ember/test-helpers dependency version.
@ijlee2
Copy link
Member

ijlee2 commented Mar 8, 2023

I also encountered the issue by running 3.28 and 4.4 LTS ember-try scenarios in a yarn workspace (specifically, after separating documentation from testing by having 2 Ember apps).

I didn't want to solve it by migrating to pnpm in the same pull request, as it was already large. Instead, I configured ember-try so that older versions of @ember/test-helpers and a few other TypeScript-related packages are installed (see the relevant commit).

/* config/ember-try.js */

module.exports = async function () {
  return {
    useYarn: true,
    scenarios: [
      {
        name: 'ember-lts-3.28',
        npm: {
          devDependencies: {
            '@ember/test-helpers': '2.7.0',
            '@types/ember__test-helpers': '2.8.3',
            '@types/ember-qunit': '6.1.1',
            'ember-qunit': '6.0.0',
            'ember-source': '~3.28.0',
          },
        },
      },
      {
        name: 'ember-lts-4.4',
        npm: {
          devDependencies: {
            '@ember/test-helpers': '2.7.0',
            '@types/ember__test-helpers': '2.8.3',
            '@types/ember-qunit': '6.1.1',
            'ember-qunit': '6.0.0',
            'ember-source': '~4.4.0',
          },
        },
      },
      /* ... */
  };
};

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

5 participants