You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v2 addons without a main file (addon-main.cjs) fail to load #11076
ember-cli throws when it loads a v2 addon that has no main file:
@scope/my-addon at /path/to/my-addon is missing its addon main file
A v2 addon in a Vite / Embroider app does not need addon-main.cjs; the file exists only for ember-cli, which loads the addon through @embroider/addon-shim.
Drop it, and every ember-cli command that loads the library fails, including ember generate inside the addon itself.
This is most visible for "type": "module" libraries.
They must keep a CommonJS addon-main.cjs only so that ember-cli can require() it.
Reproduction
Create a v2 addon with "keywords": ["ember-addon"] and "ember-addon": { "version": 2, "type": "addon" }.
Do not add main, ember-addon.main, or an index.js.
Run ember generate <any-blueprint> in the addon, or in a project that depends on it.
Expected: the command runs.
Actual: missing its addon main file.
Proposal
When a v2 addon (ember-addon.version === 2) has no main file, load it as a plain addon rooted at its package directory.
Keep the current error for v1 addons, where a missing main file is a real mistake.
Activity