简体   繁体   中英

Passport error when running sails through jxcore

I am trying to protect the code of my sailsjs project with jxp (from jxcore).
I've created the package successfully and install a bunch of modules (passport is one of them). All the installations went fine but when I run the application, I have the following error message:

luc@venus: /tmp/proj $ ~/Desktop/jx my_package.jx
/private/tmp/proj/config/passport.js.jx:10

    passport.serializeUser(function(user, done) {         ^
TypeError: Object #<Object> has no method 'serializeUser'
at Object.<anonymous> (/private/tmp/proj/config/passport.js.jx:10:14)
at Module._compile (module.js:520:26)
at Object.Module._extensions..jx (module.js:1352:405)
at Module.load (module.js:359:33)
at Function.Module._load (module.js:333:12)
at Module.require (module.js:372:17)
at require (module.js:399:17)
at Object.<anonymous> (/private/tmp/proj/config/passport.js:3:16)
at Module._compile (module.js:520:26)
at Object.Module._extensions..js (module.js:538:10)

Any idea ?

UPDATE

When using the last version of jx (beta2), I now have the following error when running jx MYPROJ.jx

/Users/luc/proj1/node_modules/sails/node_modules/winston/lib/winston.js.jx:52
winston.loggers = new winston.Container();

You just update it to latest version of JXcore, and it will work fine. I just tested a similar case without an issue.

Update

It seems that pkginfo module (one of the node modules winston uses), tries to access directory list inside the package which is limited due to protection.

There is an Issue in JXCore which is fixed in upcoming release for circular requires which does winston use.

See https://github.com/Nubisa/jxdocs/issues/123 for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM