Skip to content

Commit fa82ec1

Browse files
NullVoxPopuliclaude
andcommitted
Handle missing absolutePaths for ember-source v7+
ember-source v7 no longer exports `absolutePaths` from its addon entry point. Fall back to resolving the template compiler through the package exports map when `absolutePaths` is absent. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8cdf98c commit fa82ec1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/ember-addon-main.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,15 @@ module.exports = {
105105
);
106106
}
107107

108-
return ember.absolutePaths.templateCompiler;
108+
if (ember.absolutePaths) {
109+
return ember.absolutePaths.templateCompiler;
110+
}
111+
112+
// v7+ ember-source no longer provides absolutePaths; resolve from
113+
// the host app's directory through the package exports map
114+
let { createRequire } = require('module');
115+
let appRequire = createRequire(path.join(this.project.root, 'package.json'));
116+
return appRequire.resolve('ember-source/ember-template-compiler/index.js');
109117
},
110118

111119
astPlugins() {

0 commit comments

Comments
 (0)