Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application config is not available in main.js #6608

Closed
aro opened this issue Sep 26, 2018 · 0 comments
Closed

Application config is not available in main.js #6608

aro opened this issue Sep 26, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@aro
Copy link
Contributor

aro commented Sep 26, 2018

The app.config object, when accessed in the application main.js script, does not contain the configuration options from the app .cfg file.

It works when the same is done from a JavaScript controller.

To reproduce it, create a main.js in the application with this code:

log.info('App:\r\n' + JSON.stringify(app, null, 4));

Create a configuration file for the app: $XP_HOME/config/com.enonic.myappname.cfg

param1=value1
param2=value2

Build and deploy.
The config is printed out in the log but without the configuration properties.

{
    "name": "com.enonic.myappname",
    "version": "6.15.3",
    "config": {}
}

Reported in Discuss: https://discuss.enonic.com/t/app-config-not-loaded-upon-executing-main-es6/1668/4

@aro aro added the Bug label Sep 26, 2018
@aro aro added this to the 6.16.0 milestone Oct 2, 2018
GlennRicaud added a commit that referenced this issue Oct 24, 2018
Application config is not available in main.js (#6608)
GlennRicaud added a commit that referenced this issue Oct 24, 2018
Application config is not available in main.js (#6608)
@jsi jsi modified the milestones: 6.16.0, 6.15.5 Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants