Skip to content

Commit 99e3af0

Browse files
committed
fix(ember): resolve config path from app root
This should aid in resolving the app configuration from the right location. Previously, it was calling `require` with a relative path from the `index.js` file of the Sentry addon itself. This broke trying to actually load the configuration file in _other_ apps or addons that might include this as a dependency. The Ember addon API exposes the configuration path for a given app or addon through the `project.configPath()` method, which we can use instead to look up the location of the project's `config/environment.js` file.
1 parent d8ecb2b commit 99e3af0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/ember/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
getAddonConfig(app) {
2020
let config = {};
2121
try {
22-
config = require(app.options.configPath)(app.env);
22+
config = require(app.project.configPath())(app.env);
2323
} catch(_) {
2424
// Config not found
2525
}

0 commit comments

Comments
 (0)