Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

run 'remodel-gen' command error #19

Closed
3Byuan opened this issue Sep 19, 2016 · 1 comment
Closed

run 'remodel-gen' command error #19

3Byuan opened this issue Sep 19, 2016 · 1 comment

Comments

@3Byuan
Copy link

3Byuan commented Sep 19, 2016

try to generates the sample value file encounter a error:

remodel-gen ~/desktop/AddressBookContact.value

/usr/local/lib/node_modules/remodel-gen/bin/dist/js/object-mona-parser/value-object/value-object-parser.js:32
foundType: parsedType
^

ReferenceError: parsedType is not defined
at Object.parse as parseValueObject
at Object.parse (/usr/local/lib/node_modules/remodel-gen/bin/dist/value-object-parser.js:72:35)
at evaluateUnparsedValueObjectCreationRequest (/usr/local/lib/node_modules/remodel-gen/bin/dist/value-objects.js:31:41)
at right (/usr/local/lib/node_modules/remodel-gen/bin/dist/either.js:46:39)
at match (/usr/local/lib/node_modules/remodel-gen/bin/dist/either.js:34:16)
at Object.mbind (/usr/local/lib/node_modules/remodel-gen/bin/dist/either.js:47:12)
at parseValues (/usr/local/lib/node_modules/remodel-gen/bin/dist/value-objects.js:39:47)
at /usr/local/lib/node_modules/remodel-gen/bin/dist/logged-sequence-utils.js:20:26
at /usr/local/lib/node_modules/remodel-gen/bin/dist/promise.js:74:12
at /usr/local/lib/node_modules/remodel-gen/bin/dist/promise.js:30:13

@3Byuan
Copy link
Author

3Byuan commented Sep 23, 2016

value-object-parser.js 中的函数存在兼容性问题. 问题是ES6以后 const 的作用域发生了变化
function parse(fileInput) {
try {
const parsedType = mona.parse(parseCommon.parseNamedAttributeGroupWithIncludes(), fileInput);

} catch (e) {
return {
errorReason:e.message,
isValid:false,
foundType: null
};
}
return {
errorReason: null,
isValid: true,
foundType: parsedType
};
}

http://stackoverflow.com/questions/33457167/javascript-define-a-constant-inside-try-catch-with-strict-mode

@3Byuan 3Byuan closed this as completed Sep 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant