Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Jaydev vaghela
@jaydev943_twitter
How I can handle error globally So my server not crash ?
I am new in sails js.
Please help me..
Alex
@flexage
@brookesb91 what nodemon -L app.jsactually does is essentially run node app.js and watches the working directory for changes, as which point it terminates the sails app and restarts it, i'm using this in place of sails lift so that i can have the app automatically restart when the source changes, very handy for dev... what i could before using nodemon was to run sails debug instead of sails lift (https://sailsjs.com/documentation/reference/command-line-interface/sails-debug) which would start a debug session that I could connect to with the chrome developer tools, but i'm unsure how to pass the debug flag when not using the sails command line utils
brookesb91
@brookesb91
@flexage sorry, i understand now - I’m not currently using nodemon - wild guess but nodemon -L —inspect app.js doesn’t work, no?
Jaydev vaghela
@jaydev943_twitter
How I handle Error handling so my running server is not crash ?
Using script or package
Alex
@flexage
@brookesb91 I'm giving that a go now, the docs say it should work, i missed it in them until you said about --inspect, i can see it's spun up the debug server, but i'm having trouble getting the chrome dev tools to find it, I'll post here if i get it working :+1: thanks for the tip
brookesb91
@brookesb91
@flexage go to chrome://inspect and under devices you should see the debugger there
let me know how you get on
Alex
@flexage
@brookesb91 thanks that's where i am, and i've gone to the option for Open dedicated DevTools for Node but my sails app is running under a vagrant vm and it's not connecting, i've forwarded the port to the vm guest from my host system, so i'm just doing a little exploratory at the minute to see why the connection is being refused :+1:
brookesb91
@brookesb91
@flexage excellent, sounds like you’re back on track!
Alex
@flexage
@brookesb91 thanks! i did a quick telnet on the debug port (9229) from the host to the guest vm and was getting connection refused, but when i telnet to the same port on the guest (where the node app with --inspect flag is running) the connection opens, so it just must be a port forwarding issue..... sometimes the virtualbox config underneath vagrant decides to not update the port mappings when it should, i'm sure a manual tweak will probably fix it. Thanks for all your help dude :smile: :clap:
brookesb91
@brookesb91
@flexage awesome stuff man! :D :clap:
Waiting on someone from Sails HQ to give me that support job
Alex
@flexage
:laughing: maybe send them beer
brookesb91
@brookesb91
Haha!
fabien thetis
@fabienthetis
Congratulations!
Mukul Sharma
@mukulsoftwap
Hi
I try to connect socket.io client (Android) with sails.js sockets gives error refuse connection
Mukul Sharma
@mukulsoftwap
how to implement sails.io with Native android
Marco Romano
@marcorom88_twitter
I try to install sails 1.0 but a I have a lot of errors... The beta i installed without errors some month ago, but 1. 0 stable with a lot of problems!
Marco Romano
@marcorom88_twitter
info: Starting app...

error: A hook (`userconfig`) failed to load!
error: 
error: As of Sails v1, `sails.config.globals._` must be either `false` or a locally-installed version of Lodash (typically `require('lodash')`).  For more info, see http://sailsjs.com/config/globals

error: Could not load Sails app.
error: 
error: Tips:
error:  • First, take a look at the error message above.
error:  • Make sure you've installed dependencies with `npm install`.
error:  • Check that this app was built for a compatible version of Sails.
error:  • Have a question or need help?  (http://sailsjs.com/support)
and if I change global config I have others errors:
info: Starting app...

debug: The `config.views.engine` config has been deprecated.
debug: In Sails 1.x, use `config.views.extension` to choose your view
debug: extension (defaults to ".ejs"), and use `config.views.getRenderFn`
debug: to configure your template engine or leave it undefined to use
debug: the built-in EJS template support.

debug: The `sails.config.cors` config has been deprecated.
debug: Please use `sails.config.security.cors` instead.
debug: (we'll use your `sails.config.cors` settings for now).

debug: The `sails.config.connections` setting is deprecated.  Please use `sails.config.datastores` instead.
debug: For more info, see http://sailsjs.com/documentation/upgrading/to-v-1-0/#?changes-to-database-configuration

 info: 
 info:                .-..-.
 info: 
 info:    Sails              <|    .-..-.
 info:    v1.0.0              |\
 info:                       /|.\
 info:                      / || \
 info:                    ,'  |'  \
 info:                 .-'.-==|/_--'
 info:                 `--'-------' 
 info:    __---___--___---___--___---___--___
 info:  ____---___--___---___--___---___--___-__
 info: 
 info: Server lifted in `/home/marrom/smash_node-1.0`
 info: To shut down Sails, press <CTRL> + C at any time.
 info: Read more at https://sailsjs.com/support.

debug: -------------------------------------------------------
debug: :: Thu Mar 29 2018 22:19:52 GMT+0200 (CEST)

debug: Environment : development
debug: Port        : 1337
debug: -------------------------------------------------------
error: ** Grunt :: An error occurred. **
error: 
------------------------------------------------------------------------
Aborted due to warnings.
Loading "Gruntfile.js" tasks...ERROR
>> Error: Attempted to `require('/home/marrom/smash_node-1.0/tasks/config/watch.js')`, but an error occurred:
>> --
>> /home/marrom/smash_node-1.0/tasks/config/watch.js:26
>>       tasks: ['syncAssets' , &#39;linkAssets&#39; ]
>>                              ^
>> 
>> SyntaxError: Unexpected token &
>>   at createScript (vm.js:80:10)
>>   at Object.runInThisContext (vm.js:139:10)
>>   at Module._compile (module.js:616:28)
>>   at Object.Module._extensions..js (module.js:663:10)
>>   at Module.load (/home/marrom/smash_node-1.0/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
>>   at tryModuleLoad (module.js:505:12)
>>   at Function.Module._load (module.js:497:3)
>>   at Module.require (module.js:596:17)
>>   at require (internal/module.js:11:18)
>>   at /home/marrom/smash_node-1.0/node_modules/include-all/lib/help-include-all-sync.js:293:33
>>   at Array.forEach (<anonymous>:null:null)
>>   at _recursivelyIncludeAll (/home/marrom/smash_node-1.0/node_modules/include-all/lib/help-include-all-sync.js:178:11)
>>   at includeAll (/home/marrom/smash_node-1.0/node_modules/include-all/lib/help-include-all-sync.js:317:5)
>>   at includeAllSync (/home/marrom/smash_node-1.0/node_modules/include-all/index.js:27:10)
>>   at loadTasks (/home/marrom/smash_node-1.0/Gruntfile.js:46:12)
>>   at Object.module.exports (/home/marrom/smash_node-1.0/Gruntfile.js:68:28)
>>   at loadTask (/home/marrom/smash_node-1.0/node_modules/grunt/lib/grunt/task.js:318:10)
>>   at Task.task.init (/home/marrom/smash_node-1.0/node_modules/grunt/lib/grunt/task.js:437:5)
>>   at Object.grunt.tasks (/home/marrom/smash_node-1.0/node_modules/grunt/lib/grunt.js:111:8)
>>   at Object.module.exports [as cli] (/home/marrom/smash_node-1.0/node_modules/grunt/lib/grunt/cli.js:27:9)
>>   at Object.<anonymous> (/home/marrom/smash_node-1.0/node_modules/sails-hook-grunt/node_modules/grunt-cli/bin/grunt:44:20)
>>   at Module._compile (module.js:652:30)
>>   at Object.Module._extensions..js (module.js:663:10)
>>   at Module.load (module.js:565:32)
>>   at tryModuleLoad (module.js:505:12)
>>   at Function.Module._load (module.js:497:3)
>>   at Module.require (module.js:596:17)
>>   at require (internal/module.js:11:18)
>>   at Object.<anonymous> (/home/marrom/smash_node-1.0/node_modules/sails-hook-grunt/lib/grunt-wrapper.js:10:1)
>>   at Module._compile (module.js:652:30)
>
Marco Romano
@marcorom88_twitter
and if I choice installed web app do not installed any files and seems to 0.12 and not 1.0, all seems to be strange... I try 1.0 beta and works, and 1.0 stable do not work and seems different, I don't understand
Abrar Ahmed
@abrarahmedme
How can I use await functions inside for functions inside the model.
This is an example function inside a model
MyFunctionName: async function (options, cb) { await User.update({name: 'Mike'}) .set({ last_name: 'Williams' }) }
Tim Skaggs
@tskaggs
@marcorom88_twitter Did you try npm install -g sails@1.0.0?
Also I'm running on Node v9.10.0
Abrar Ahmed
@abrarahmedme
Suddenly it works now
Leo Montes
@leonardomontes
... just spent 1 hour trying to get a simple POST to work on v1 ... forfeit, going back to 0.12
Thomas Lepérou
@tleperou
@mikermcneil & all the team, congratulation! What a great news!
Mike McNeil
@mikermcneil
@leonardomontes too bad... if you want blueprints, generate your app as "Empty", or re-enable blueprints in your config. The "Web App" template disables them by default.
@marcorom88_twitter check out the upgrade tool if you haven't previously
Not sure why you're getting the &#39 -- I'm not able to reproduce that. Are you seeing it in a brand new project?
@jaydev943_twitter if you use await, you should completely eliminate this problem (unless -- much more unlikely -- your use case demands lots of streaming APIs, and the app code does not handle "error" events -- but in that case, def. check out sails-hook-uploads and the ration example app)
Mike McNeil
@mikermcneil
@entvikas re "express database modules" -- the things listed on that page are just NPM packages, unrelated to express, and maintained by unassociated open source contributors, for the most part (with the exception, at least, of mysql, which Doug maintains. Waterline's MySQL integration uses it as well.) Anyway, you can require those packages from any Node.js project, it has nothing to do with Express
btw @/all - just added some new integrations to gitter: the Sails roadmap (Trello) and the sails-hook-organics, sails-hook-uploads, parasails, and ration repos
Good night everyone - and thanks for the continued support!
Mukul Sharma
@mukulsoftwap
please give some suggestion how to use sails.io with nativ android ???
nobody give my question's answer please help me, if it is not possible tell me i will use express instead of sails.js
Mukul Sharma
@mukulsoftwap
@mikermcneil can you please suggest me how to use sails.io with nativ android ???, or we can use socket.io directy in sails
Marco Romano
@marcorom88_twitter
@tskaggs do not works how you suggest. Always errors and do not install files of 1.0 but of 0.12...
If I resolve errors start but first page is the same of 0.12, and if I choice we app I don't have files of example...
Marco Romano
@marcorom88_twitter
I'm come back because it is impossible installing correctly version 1.0 of sails! Beta I installed correctly 1 month ago, and stable doesn't install correctly...
red-duck
@red-duck
v1.0 is one hell of a show stopper. after years of development, cannot understand why we still have no custom validation messages in models. it's in pretty much all other server side frameworks.
Another thing I noticed was that if you have a unique validation rule on one attribute and a required rule on another, the unique validation never gets checked/thrown, so you end up getting a false positive on some fields.
dan-astiak
@dan-astiak
If your api or config folders and subfolders contain any non-source files, they’ll need to be moved. The exception is for Markdown (.md) and text (.txt) files, which will continue to be ignored. Sails will attempt to read all other files in those folders as code, allowing for more flexibility in choosing a Javascript dialect (see the notes about CoffeeScript and TypeScript above).