sails-auth module gives "Cannot read property 'loadStrategies' of undefined" - javascript

I've installed the npm module and when lifting my application, it gives the following error. I was not able to find any suitable solution in the GitHub Issues or Wiki.
The module is here. I've already included in my config directory passport.js and auth.js files, as they have noted.
$ sails lift
info: Starting app...
/home/me/Documents/projects/margin/node_modules/sails-auth/api/hooks/sails-auth.js:4
sails.services.passport.loadStrategies();
^
TypeError: Cannot read property 'loadStrategies' of undefined
at Hook.initialize (/home/me/Documents/projects/margin/node_modules/sails-auth/api/hooks/sails-auth.js:4:30)
at Hook.bound [as initialize] (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
at /usr/local/lib/node_modules/sails/lib/hooks/index.js:75:14
at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:454:17
at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:444:17
at Array.forEach (native)
at _each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:46:24)
at Immediate.taskComplete (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:443:13)
at processImmediate [as _immediateCallback] (timers.js:358:17)

I had the same problems in one of my sails app repositories. I fixed it by installing a previous version of sails-auth.
npm install sails-auth#1.2.3
This fixed it for me. I also updated dependency reference for my package.json from
"sails-auth": "^1.0.10",
to
"sails-auth": "1.2.3",
After this I was able to lift with no problems. I created an issue report here: https://github.com/balderdashy/sails/issues/3385
Hope this helps.

Related

Can get a prisma graphql to compile

When I run npm run dev I get this error and I have no idea what is causing it
I have installed all the packages and reinstalled them.
I have applied all of the migrations.
I have re-cloned the repo and done all the steps again and I cant seem to get past this error.
Error: Upload was already defined and imported as a type, check the docs for extending types
at extendError (C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\builder.ts:1743:10)
at SchemaBuilder.addType (C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\builder.ts:602:15)
at C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\builder.ts:1696:14
at C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\utils.ts:147:41
at Array.forEach (<anonymous>)
at eachObj (C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\utils.ts:147:20)
at SchemaBuilder.traverseArgs (C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\builder.ts:1693:12)
at SchemaBuilder.maybeTraverseOutputFieldType (C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\builder.ts:1688:12)
at Object.addField (C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\builder.ts:1640:29)
at ObjectDefinitionBlock.field (C:\Users\coope\dev\paypixl\backend\node_modules\nexus\src\definitions\definitionBlocks.ts:712:22)
[ERROR] 10:03:59 Error: Upload was already defined and imported as a type, check the docs for
extending types

How can I resolve a TypeError using old version of ember and ember-light-table?

I have the test project at https://github.com/ericg-ember-questions/test_computed_sort
I setup the project by doing the following:
Node version: v12.18.1 (npm v6.14.5)
npm install --save-dev ember-cli#3.4
./node_modules/.bin/ember new test_computed_sort
cd test_computed_sort/
./node_modules/.bin/ember install ember-light-table#1.13.2
./node_modules/.bin/ember generate component test-comp
./node_modules/.bin/ember serve
application.hbs
{{test-comp}}
test-comp.hbs
Hello
{{#light-table}}
{{/light-table}}
If I comment out the reference to light-table, no error is generated. However, with it, I see in the console:
media.js:15 Uncaught TypeError: decorator is not a function
at media.js:15:1
at Array.reduce (<anonymous>)
at _applyDecoratedDescriptor (media.js:15:1)
at Module.callback (media.js:240:1)
at Module.exports (loader.js:106:1)
at Module._reify (loader.js:143:1)
at Module.reify (loader.js:130:1)
at Module.exports (loader.js:104:1)
at requireModule (loader.js:27:1)
at Class._extractDefaultExport (index.js:432:1)
What can I do to resolve this error so I can use ember-light-table with this project?
The error kinda hints at this, but it doesn't really make sense unless you're using modern ember -- but you're using 3.4 (thanks for providing that information!!)
The stack in your error is actually very helpful, and here's how you can figure out what the issue is.
I downloaded your reproduction repo (thanks for providing that! reproductions are immensely helpful in debugging!)
I got the same error you did:
The key piece here is the media.js reference.
Clicking into that we see:
that the compiled version of the ember-responsive/services/media file is using decorators --
you have some version of ember-responsive in your app which has decorators.
I saw in your package.json that you're specifying on alder version:
"ember-responsive": "^4.0.2",
this v4 version of ember-responsive only supports ember 3.13 and higher.
Kinda poking around the ember-responsive github, https://github.com/freshbooks/ember-responsive/blob/v3.0.5/config/ember-try.js
I see that the v3 series of ember-responsive supports back to Ember 2.12 -- definitely before decorators before supported.
So downgrading ember-responsive and restarting the app reveals this error:
"Assertion Failed: [ember-light-table] table must be an instance of Table"
this error is documented here: https://github.com/adopted-ember-addons/ember-light-table/issues/726
so it looks like some APIs usage issue.
If you want help figuring that out, feel free to post another question.

Cannot read property 'engine' of undefined - Webpack React

I try to learn React.JS, by typing "webpack" command, i found this error :
Hash: 04008667f996e5267ae1 Version: webpack 1.14.0 Time: 580ms
+ 2 hidden modules
ERROR in ./public/assets/react-source/catalog-app.js Module build
failed: TypeError: Cannot read property 'engine' of undefined
at load (/var/www/html/web/node_modules/transform/index.js:33:18)
at Object.transform (/var/www/html/web/node_modules/transform/index.js:19:3)
ERROR in ./public/assets/react-source/catalog-custom-item-app.js
Module build failed: TypeError: Cannot read property 'engine' of
undefined
at load (/var/www/html/web/node_modules/transform/index.js:33:18)
at Object.transform (/var/www/html/web/node_modules/transform/index.js:19:3)
Anyone can help pls ?
Already installed react-engine. My react app running well before.
Problem solved by typing this command :
npm install transform
then
npm install

Angular 2 debugging issues

I'm starting out on a sizeable angular 2 project and am having a lot of difficulty debugging. I am using Angular-CLI, WebStorm and Chrome.
Whenever I run into an issue, firstly my IDE fails to catch any problems with the typescript. No matter the issue, the browser always shows this error about 15 times, could be because of a syntax error in my code, injecting incorrectly, constructor problems, or markup issues.
EXCEPTION: Uncaught (in promise): TypeError: Cannot set property 'stack' of undefined
TypeError: Cannot set property 'stack' of undefined
at NoProviderError.set [as stack] (http://localhost:4200/vendor.bundle.js:6147:61)
at assignAll (http://localhost:4200/vendor.bundle.js:98290:29)
at NoProviderError.ZoneAwareError (http://localhost:4200/vendor.bundle.js:98361:16)
at NoProviderError.BaseError [as constructor] (http://localhost:4200/vendor.bundle.js:6109:16)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:4200/vendor.bundle.js:58296:16)
at new NoProviderError (http://localhost:4200/vendor.bundle.js:58345:16)
at ReflectiveInjector_._throwOrNull (http://localhost:4200/vendor.bundle.js:79884:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:4200/vendor.bundle.js:79921:25)
at ReflectiveInjector_._getByKey (http://localhost:4200/vendor.bundle.js:79871:25)
at ReflectiveInjector_.get (http://localhost:4200/vendor.bundle.js:79633:21)
at AppModuleInjector.NgModuleInjector.get (http://localhost:4200/vendor.bundle.js:59199:52)
at CompiledTemplate.proxyViewClass.AppView.injectorGet (http://localhost:4200/vendor.bundle.js:80642:45)
at CompiledTemplate.proxyViewClass.DebugAppView.injectorGet (http://localhost:4200/vendor.bundle.js:81070:49)
at ElementInjector.get (http://localhost:4200/vendor.bundle.js:80150:27)
at ReflectiveInjector_._getByKeyDefault (http://localhost:4200/vendor.bundle.js:79918:24)
How am I supposed to figure out the issue from this error message? Is there a tool to help understand this?
I faced the same error, the details of the error mentioned above can be seen by upgrading zone.js version in package.json to ^0.7.4(anything greater than version 0.7.4).
You can also upgrade by this npm terminal command:
npm install --save zone.js#0.7.4
Other than this I use the Intellij (JetBrains), angular-cli and chrome and debugging goes quite easy.

Error with "cake build:browser" and Uglify.js -- Cannot read property 'Array' of undefined

I just installed Uglify.js and tried to use it to rebuild CoffeeScript, but keep getting this error. This happens when I type "cake build:browser" in the CoffeeScript directory. (I want to try my hand at modifying the CoffeeScript language.)
My Uglify.js was cloned from GitHub and the symbolic link was created in .node_libraries. Uglify is installed correctly, confirmed since it runs properly in Node and through the command line. So maybe this is a CoffeeScript problem.
Help?
/Users/myuser/projects/UglifyJS/lib/process.js:475
return options.defines[name];
^
TypeError: Cannot read property 'Array' of undefined
at get_define (/Users/myuser/projects/UglifyJS/lib/process.js:475:47)
at Array.<anonymous> (/Users/myuser/projects/UglifyJS/lib/process.js:527:32)
at walk (/Users/myuser/projects/UglifyJS/lib/process.js:215:47)
at Array.<anonymous> (/Users/myuser/projects/UglifyJS/lib/process.js:164:59)
at walk (/Users/myuser/projects/UglifyJS/lib/process.js:220:36)
at Array.<anonymous> (/Users/myuser/projects/UglifyJS/lib/process.js:146:43)
at walk (/Users/myuser/projects/UglifyJS/lib/process.js:220:36)
at /Users/myuser/projects/UglifyJS/lib/process.js:1643:37
at Array._block (/Users/myuser/projects/UglifyJS/lib/process.js:81:34)
at walk (/Users/myuser/projects/UglifyJS/lib/process.js:220:36)
OK, I was able to replicate this. But why are you cloning the UglifyJS repo? If you just do npm install uglify-js to install to the local node-modules directory (with npm 1.x), everything runs fine.
Similar issue: https://github.com/mishoo/UglifyJS/issues/140

Categories

Resources