When I try parse YANG model in browser, it throws error as below:
ERROR TypeError: Cannot assign to read only property 'module' of function 'function evaluate() {
var _self;
return (_self = self).eval.apply(_self, arguments);
}'
here is the YANG model which I was parsed
const schema = `
module foo {
include foo-sub;
container foo {
leaf a { type string; }
leaf b { type uint8; }
list bar {
key "b1";
leaf b1 { type uint16; }
container blob;
}
uses fs;
}
}`;
const subSchema = `
submodule foo-sub {
yang-version 1.1;
belongs-to foo {
prefix "foo";
}
grouping fs {
container fs {
leaf c {
mandatory true;
type string {
length "1..max";
}
description
"The alias of effective master key.";
}
}
}
}`;
let instance2 = (window as any).Yang.use(
(window as any).Yang.parse(subSchema, { compile: false })
);
instance2 = (window as any).Yang.use(
(window as any).Yang.parse(schema, { compile: false })
);
const compileResult = instance2.compile();
and error throw with this line
could anyone help with this? or give some hints? thanks!
When I try parse YANG model in browser, it throws error as below:
here is the YANG model which I was parsed
and error throw with this line![image](https://user-images.githubusercontent.com/3843953/210756926-8a08bc31-ec76-41f7-a875-f4ee563ea866.png)
could anyone help with this? or give some hints? thanks!