Skip to content

Enable classicEmberSupport() for compat-build scenarios#319

Merged
NullVoxPopuli merged 3 commits intoember-cli:nvp/its-vite-timefrom
NullVoxPopuli-ai-agent:fix/compat-build-classic-ember-support
Apr 19, 2026
Merged

Enable classicEmberSupport() for compat-build scenarios#319
NullVoxPopuli merged 3 commits intoember-cli:nvp/its-vite-timefrom
NullVoxPopuli-ai-agent:fix/compat-build-classic-ember-support

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown

Summary

Fixes the three red try-scenarios on #317min-supported, ember-lts-4.12, ember-lts-5.12 — which were failing at the vite build step with:

[vite]: Rollup failed to resolve import "ember-testing" from
"test-app/tests/index.html?html-proxy&index=0.js".

All three scenarios set ENABLE_COMPAT_BUILD=true and swap in a classic ember-cli-build.js that uses compatBuild from @embroider/compat. test-app/tests/index.html has <script type="module">import "ember-testing";</script>, a bare-specifier import that only resolves when classicEmberSupport() from @embroider/vite is active. In the default (non-compat) build ember() alone is enough, which is why ember-latest, ember-lts-6.4, ember-beta, and ember-alpha are all green.

Spread classicEmberSupport() into the plugin list only when ENABLE_COMPAT_BUILD is set, matching the pattern in ef4/memory-scroll/vite.config.mjs:

plugins: [
  ...(process.env.ENABLE_COMPAT_BUILD ? [classicEmberSupport()] : []),
  hbs(),
  ember(),
  // ...
]

Test plan

  • min-supported, ember-lts-4.12, ember-lts-5.12 jobs all go green
  • Non-compat scenarios (ember-latest, ember-lts-6.4, ember-beta, ember-alpha) remain green — classicEmberSupport() is only spread in when ENABLE_COMPAT_BUILD=true
  • Regular Tests (chrome|firefox) and Floating Dependencies jobs (which don't set the env var) are unaffected

🤖 Generated with Claude Code

NullVoxPopuli and others added 3 commits April 18, 2026 19:52
The min-supported, ember-lts-4.12, and ember-lts-5.12 try-scenarios all
set ENABLE_COMPAT_BUILD=true and install @embroider/compat + ember-auto-import
so they can exercise the classic Ember 4.x/5.12 resolution path. The compat
scenario was failing with:

    [vite]: Rollup failed to resolve import "ember-testing" from
    "test-app/tests/index.html?html-proxy&index=0.js".

`tests/index.html` has `<script type="module">import "ember-testing";</script>`
which is a bare specifier that needs the classic resolver. In the default
build, `ember()` is enough, but the compat path requires
`classicEmberSupport()` (see ef4/memory-scroll vite.config.mjs for the
reference pattern).

Spread `classicEmberSupport()` into plugins only when ENABLE_COMPAT_BUILD is
set, matching the pattern already used by the try scenarios themselves.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
test-app/package.json has "type": "module", so an ember-cli-build.js file
would be parsed as ESM. The generated content is CommonJS (require /
module.exports), so the file needs a .cjs extension to be interpreted
correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NullVoxPopuli NullVoxPopuli merged commit 1512bf9 into ember-cli:nvp/its-vite-time Apr 19, 2026
18 of 20 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 22, 2026
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

Successfully merging this pull request may close these issues.

2 participants