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
When I pass object to use() function as module options I get following error. But this happens only if the object is loaded by config. If I clone the configuration object or hardcode it, then it works fine.
Here are details:
node.js: 6.11.4, 8.9.3, 8.11.2
Seneca: 3.5.0
=== SENECA FATAL ERROR ===
MESSAGE: ::: seneca: Cannot assign to read only property 'enabled' of object '#<Object>'
CODE: ::: plugin_undefined
INSTANCE ::: Seneca/7767rwgjflva/1526638227646/23360/3.5.0/-
DETAILS ::: {}
STACK ::: TypeError: Cannot assign to read only property 'enabled' of object '#<Object>'
at build_plugindesc (D:\work\projects\gveli-server\node_modules\use-plugin\use.js:150:31)
at Object.use (D:\work\projects\gveli-server\node_modules\use-plugin\use.js:68:22)
at Seneca.api_use [as use] (D:\work\projects\gveli-server\node_modules\seneca\seneca.js:838:29)
at Object.<anonymous> (D:\work\projects\gveli-server\test\services\gveli-hub\users.service.test.js:14:8)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
WHEN ::: 2018-05-18T10:10:27.674Z
LOG ::: {kind:null,plugin:seneca,tag:3.5.0,id:7767rwgjflva/1526638227646/23360/3.5.0/-,code:plugin_undefined,notice:sen
event-logger.service.js is normal Seneca plugin. It does not affect the error.
module.exports=function(options){constseneca=this;constanalytics_enabled=options.enabled===true;constanalytics_url=options.url;if(analytics_enabled){seneca.log.info(`Using analytics at ${analytics_url}`);}seneca.add({role:'logger',event:'sync'},(msg,reply)=>{
.....
The is the line from use.js of use-plugin where the error happens:
// Options as an argument to the _use_ function override options// in the plugin description object.plugindesc.options=Object.assign(plugindesc.options||{},options||{})
This merging is not directly Seneca code, but to me it looks like Seneca is breaking promise to accept options for plugins. And it was working previously fine.
The text was updated successfully, but these errors were encountered:
When I pass object to use() function as module options I get following error. But this happens only if the object is loaded by config. If I clone the configuration object or hardcode it, then it works fine.
Here are details:
node.js:
6.11.4
,8.9.3
,8.11.2
Seneca:
3.5.0
My conf json:
This was working fine previously but now produces the error:
This works fine:
This is the error message:
event-logger.service.js is normal Seneca plugin. It does not affect the error.
The is the line from use.js of use-plugin where the error happens:
This merging is not directly Seneca code, but to me it looks like Seneca is breaking promise to accept options for plugins. And it was working previously fine.
The text was updated successfully, but these errors were encountered: