Skip to content

Commit c7382fc

Browse files
authored
Merge pull request #53 from nuxt-community/fix-config-set
fix: properly set config so it dont complain about invalid key on server
2 parents 0a1ffa1 + 132557a commit c7382fc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/module.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,14 @@ module.exports = function appInsights (moduleOptions) {
6464
logger.info('Server errors will not be logged because no serverConnectionString provided')
6565
return
6666
}
67+
6768
const appInsightsServer = AppInsights.setup(optionsServer.serverConnectionString)
68-
const config = { ...AppInsights.defaultClient.config, ...optionsServer.serverConfig }
6969

70-
AppInsights.defaultClient.config = config
7170
// Initialize AppInsights
71+
for (const [key, value] of Object.entries(optionsServer.serverConfig)) {
72+
AppInsights.defaultClient.config[key] = value
73+
}
74+
7275
if (optionsServer.initialize) {
7376
appInsightsServer.start()
7477
}

0 commit comments

Comments
 (0)