From 4e7cdc02f1507df6ff4cebd6ef99afe17d9b3d57 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 18 Apr 2026 20:29:49 -0400 Subject: [PATCH] Bump @ember/test-helpers to ^4 in ember4 try scenarios `min-supported` and `ember-lts-4.12` were failing in vite build with: [vite]: Rollup failed to resolve import "require" from ".../@ember/test-helpers/-internal/build-registry.js" The line responsible is at the top of `@ember/test-helpers@3.x/addon-test-support/@ember/test-helpers/-internal/build-registry.ts`: import require, { has } from 'require'; This is the AMD `require` module provided by classic Ember's loader.js. When vite/rollup processes this file (after `@embroider/compat` rewrites it into the addon's `rewritten-packages` tree), there is no `require` module to resolve and the build fails. `@ember/test-helpers@4.0.0` dropped that import and re-implemented build-registry on top of `@ember/-internals/container` and `./-owner-mixin-imports.js`, so it no longer depends on a loader.js-style `require`. Its peer is `ember-source >= 4.0.0`, which satisfies both the min-supported scenario (~4.2.0) and ember-lts-4.12. `ember-qunit@^8.0.0` peers `@ember/test-helpers: >=3.0.3`, so the bump does not violate it. Also bump `@ember/test-waiters` to `^3.1.0` to stay within the window expected by test-helpers 4. Co-Authored-By: Claude Opus 4.7 (1M context) --- test-app/.try.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-app/.try.mjs b/test-app/.try.mjs index ac98e56..085d877 100644 --- a/test-app/.try.mjs +++ b/test-app/.try.mjs @@ -17,8 +17,8 @@ module.exports = async function (defaults) { }; const ember4 = { - '@ember/test-helpers': '^3.2.1', - '@ember/test-waiters': '^3.0.0', + '@ember/test-helpers': '^4.0.0', + '@ember/test-waiters': '^3.1.0', '@embroider/compat': '^4.0.3', 'ember-qunit': '^8.0.0', 'ember-cli': '~4.12.0',