Closed adwydman closed 8 years ago
There must be a reason! But the reason might be an accident ;p
Please log the value of AccessStrategyType
just before calling new AccessStrategyType
:)
There must be a reason! But the reason might be an accident ;p
"There must be a reason!" sounds like a cool slogan of a religious group. :D
Please log the value of AccessStrategyType just before calling new AccessStrategyType :)
It's prints an empty object {}
, which is strange, because the file is exporting a whole function.
Hmmm, it seems like a problem with circular dependencies. What node
version are you using? Have you tried running the test on a different version?
Can Node version affect the way code is executed so that it's broken on one version and working on the other?
Yes, I had that exact problem - there's a been a change somewhere around version 5 to how Node handles circular dependencies, and I saw Sealious fail on newer version, while working fine on the older version. I cannot put my finger on how exactly did the behavior change - so I'll give a kingdom for a simple test-case demonstrating that!
Please try changing your Node version.
Noted.
It doesn't work either way.
Which commit are you on? Could you try it on 829cb67c1b1b48f4f1b5?
This is what I get when I run tests:
$ npm test
> sealious@0.7.11 test C:\Users\anwi\Desktop\sealious
> node ./tests/test.js
C:\Users\anwi\Desktop\sealious\lib\subject\subject-types\resource-type-field-subject.js:14
ResourceFieldTypeSubject.prototype = Object.create(Sealious.Subject.prototype);
^
TypeError: Cannot read property 'prototype' of undefined
at Object.<anonymous> (C:\Users\anwi\Desktop\sealious\lib\subject\subject-types\resource-type-field-subject.js:14:68)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\anwi\Desktop\sealious\lib\subject\subject-types\single-resource-subject.js:4:32)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
npm ERR! Test failed. See above for more details.
ResourceFieldTypeSubject.prototype = Object.create(Sealious.Subject.prototype);
This line is no longer present on the references
branch. Please pull the latest changes. If you're on a different branch, merge references
into it :)
I checked out on 829cb67
as you asked and this is what I got when running tests.
I see, then - the problem should go away if you try the latest references
branch. If that's the case, please close this issue :)
Yes, tests work on references
.
I am unable to test modules that use
new AccessStrategyType
, because I get this error all the time. Example stack:Is there any reason behind this?