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

Issue with importing Yang file with Extensions #137

Open
k-jay-c opened this issue May 25, 2021 · 1 comment
Open

Issue with importing Yang file with Extensions #137

k-jay-c opened this issue May 25, 2021 · 1 comment

Comments

@k-jay-c
Copy link

k-jay-c commented May 25, 2021

@sekur

I am trying to import some Yang files which are part of an application that contains various extension.

When trying to import, I'm getting the following error:

unable to parse '/Volume/Samsung/yangTest/tailf-common.yang' YANG module from '/Volume/Samsung/yangTest/tailf-common.yang'
/Volumes/Samsung/code/node_modules/yang-js/lib/node.js:223
          throw e;
          ^

Error [ExpressionError]: [extension(export)/tailf:use-in(module)] encountered unknown extension 'tailf:use-in'
    at Function.error (/Volumes/Samsung/code/node_modules/yang-js/lib/element.js:74:17)
    at Function.error (/Volumes/Samsung/code/node_modules/yang-js/lib/expression.js:149:21)
    at Function.compile (/Volumes/Samsung/code/node_modules/yang-js/lib/yang.js:166:22)
    at /Volumes/Samsung/code/node_modules/yang-js/lib/expression.js:66:20
    at Array.forEach (<anonymous>)
    at Function.compile (/Volumes/Samsung/code/node_modules/yang-js/lib/expression.js:65:20)
    at Function.compile (/Volumes/Samsung/code/node_modules/yang-js/lib/yang.js:168:22)
    at Function.parse (/Volumes/Samsung/code/node_modules/yang-js/lib/yang.js:103:16)
    at /Volumes/Samsung/code/node_modules/yang-js/lib/yang.js:87:23
    at Array.map (<anonymous>) {
  uri: 'extension(export)/tailf:use-in(module)',
  src: <ref *1> [Function: evaluate] Yang {
    parent: <ref *2> [Function: evaluate] Yang {
      'tailf:use-in': [ [Circular *1] ],
      'tailf:occurence': [
        [Function: evaluate] Yang {
          parent: [Circular *2],
          [Symbol(element:index)]: 1
        }
      ],
      description: [Function: evaluate] Yang {
        parent: [Circular *2],
        [Symbol(element:index)]: 2
      },
      [Symbol(element:cache)]: [
        [Circular *1],
        [Function: evaluate] Yang {
          parent: [Circular *2],
          [Symbol(element:index)]: 1
        },
        [Function: evaluate] Yang {
          parent: [Circular *2],
          [Symbol(element:index)]: 2
        }
      ]
    },
    [Symbol(element:index)]: 0
  },
  ctx: undefined
}

[Done] exited with code=1 in 0.236 seconds

The script I'm executing is as follows:

const Yang = require('yang-js');

const imp = Yang.import('/Volume/Samsung/yangTest/tailf-common.yang');

Attached are the following yang files within the zip
yang.zip
: tailf-common.yang, tailf-cli-extensions.yang and tailf-meta-extensions.yang

Any help you can provide in understanding or enabling importing of the yang files will be of great help.

Kind Regards,
Jay.

@Verten
Copy link

Verten commented Jan 5, 2023

The same error i have met, how do you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants