Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • 14:58
    nassimnasibullah starred balderdashy/sails
  • 05:33
    CrazyOptimist closed #7056
  • 05:33
    CrazyOptimist commented #7056
  • 05:12
    CrazyOptimist commented #7056
  • 05:10
    CrazyOptimist commented #7056
  • 05:06
    CrazyOptimist commented #7056
  • 01:48
    ycxycx114 starred balderdashy/sails
  • Oct 30 20:22
    machiso starred balderdashy/sails-docs
  • Oct 30 16:09
    sailsbot commented #7061
  • Oct 30 16:09
    eashaw opened #7061
  • Oct 30 16:04

    eashaw on test-update

    Update globals.test.js (compare)

  • Oct 30 13:18
    RodrigoRodriguesX10 commented #6957
  • Oct 30 08:44
    sailsbot unlabeled #6957
  • Oct 30 08:44
    leooxx commented #6957
  • Oct 30 06:53
    sailsbot commented #7060
  • Oct 30 06:53
    alxndrsn opened #7060
  • Oct 30 06:41
    crimson-med starred balderdashy/sails
  • Oct 30 01:52
  • Oct 30 01:43
    cnopens starred balderdashy/sails
  • Oct 29 21:01
    ath88 commented #6804
Mike McNeil
and added to unofficial FAQ for future reference:
  1. Best practice Grunt Per-page <script> tags or other HTML code. "how to make view's scripts below layout's scripts" (also includes a bit of explanation of conditionally including robots/nofollow meta tag, Google Analytics, helpdesk chat, etc. based on environment. Also on customizing the linker, vaguely) StackOverflow answer https://stackoverflow.com/a/49601419/486547
Corey Birnbaum
I know this is stupid but I'm confused by the socketio sails docs. I just want to use es6 imports for the io client in the browser to connect to the sails backend. Which npm package do I use?
Lalit Indoria
Does anyone know how to get the relation name in a populate action with blueprints enabled? For example, if I do a /locations/1/menu, I can get the 1 as :parentid but how do I get the menu?
@vonWolfehaus so normally I always just recommend using the global io that's provided out of the box by the default sails.io.js file in new apps, if at all possible. It'll make your life easier. But if that's not an option or it'd be very hard to do (e.g. you're using ReactNative), then it's definitely possible. Here's what I did to get it working in react native: https://github.com/mikermcneil/chatkin/blob/e2837612ed3c75689f66e22efbd571840d999b68/mobileapp/components/index.js#L79-L109
Osmel Guarepo
hi im starting with webrtc, can i see a project of a simple example like two people meeting?anyone?
Mike McNeil
@vonWolfehaus In a relatively recent project we did with ionic/the world of angular≥2, it was actually easier-- we were able to just drop the default sails.io.js file in Ionic's "assets" and then access it like this: https://gist.github.com/mikermcneil/2d886a4efbb6efd5b5947a1aff311d46
Mike McNeil
@osmelg I haven't used webrtc much myself, but I know it's possible - https://www.respoke.io/ is using Sails
@vonWolfehaus and here's yet another way (without using the io global) that I know for sure works in Angular 4:
// Wrap instantiation of sails.io.js in a module, so it can be safely shared
// required from different modules even if they're nested within each other.
var io = require('sails.io.js/sails.io.js')(require('socket.io-client/dist/socket.io.js'));
module.exports = io;
@vonWolfehaus but again-- by far the best way IMO is just to use the default, bundled client and rely on the io global available on the window
(that way, your team can save the energy/productivity/creativity you'd spend messing with the build/tooling, and can spend it somewhere else instead)
Osmel Guarepo
@mikermcneil let me check it, thank you crack!
John Wolfe
is there any documentation around setting up a self-signed ssl cert with sails for local development? facebook just implemented a new policy with their social login that prevents testing fb login on http, it only works on https
Corey Birnbaum
@mikermcneil That's useful info, thank you for the recommendation. Then I'll try to find the sailsio for the version of sails I'm using (I didn't think I'd use it and got rid of it because I'm an idiot hahah) and just use the global. Cheers!
Thomas Lepérou
@wolfejw86 check this out
Then, generate your key openssl genrsa -out path/to/save/the/key 2048
@mikermcneil Adding |ts|map to all occurrences of filter inside these 2 files solved my problem but that means I have to do this for all npm install and after every update
files are : sails/lib/hooks/moduleloader/index.js
John Wolfe
@tleperou perfect, I've done the key/cert with the node https module before, and I figured it would be similar, should've just tried passing it the same dictionary 😶 Thanks this is perfect.
Mouad Belbah
@mikermcneil hey is it possible to customize validation errors in actions2 ?? the ones thrown due to validation in inputs
Markus Mazurczak
Hi all. I am trying to access a helper using sails.helper inside an React.Component always getting "sails is not defined". It is defined as global accessible in config/globals.js. I dont understand how to access an helper inside an React Component class. Any advice?
Markus Mazurczak
Inside the constructor of my React-Component i simply try to access lodash using: console.log(.isArray(this.state)); Which yields: Uncaught ReferenceError: is not defined
Shreyash Gupta

npm ERR! code E404
npm ERR! 404 Not Found: @sailshq/lodash@^3.10.2

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Shraiysh\AppData\Roaming\npm-cache_logs\2018-04-02T10_21_51_488Z-debug.log

I am getting this error.
Please help.
Markus Mazurczak
@shraiyshv_twitter You installed the lodash module? npm install --save lodash
Daniel Harvey
Question re the .populateAll() method. There is a deprecated method notice node_modules/waterline/lib/waterline/utils/query/get-query-modifier-methods.js:154 but the second parameter is not formally documented. What is the status of this? Just needs documenting?
Hi, I am trying to find an encrypted attribute like await User.find({ssn: '555-55-5555'}).decrypt();
However, i get an empty response. await User.find().decrypt(); works fine and i get all results decrypted. Have i missed something?
Equipo Kuuijes
@mikermcneil We would love to help translating core messages to spanish, we jus need a config file or locales/json estructure to use, or maybe i18n config for core messages? We would love to help spread sailsjs here in mexico, thank you for the hard work.
Marco Romano
Hi. If I start some days ago a project with sails, it is possible use some api written on express js inside project with sails? I have a problem: I want write this project on sails but I have few times and I need working login shared between web app and android app. But the login written on express don't have a session and on mongodb have yet some users with custom hashing. How can resolve this problem?
Jaydev vaghela

In populate() select option is not work when i use sub populate for same table

Example : populate('user_id',{select:['name']}).populate('user_id.feeds',{select:['title']})

aggregate function not work on sails it show "cursor" is required
Please provide solution
Velin Kerkov
Hello, has anyone been able to use sails v1 with 2 different dbs using waterline ?
If I use only mysql or mongodb everything works, however if I set MongoDB as default and create a separate datastore property for the MySQL connection Sails just wont load
The error is Could not tear down the ORM hook. Error details: Error: Consistency violation: Attempting to tear down a datastore (default) which is not currently registered with this adapter. This is usually due to a race condition in userland code (e.g. attempting to tear down the same ORM instance more than once), or it could be due to a bug in this adapter.
Velin Kerkov
Also it is very unclear to me how to post this as bug or issue somewhere where it will stay. :)
Velin Kerkov
Also will sails-mysql support JSON type ?
Velin Kerkov
Anyone ?
@mp3por I haven’t had time to try and replicate your issue yet but I can try later - In the meantime take a look here => https://github.com/balderdashy/sails/issues
Usually someone gets back pretty quickly
Eric Maddox
With the new sails 1.0, where is code that requires some pages be logged in and other not to be logged in?
Velin Kerkov
@brookesb91 10x
@mp3por sails-mysql can support JSON types in the database - was there anything else you needed to know?
@maddtech You’ll want to look at policies for tat
Mukul Sharma
i have try sails.js v 1 and choose web app option in cmd , how can i use rest api