Open erwinsetiawan opened 6 years ago
@erwinsetiawan Thanks for posting, we'll take a look as soon as possible.
For help with questions about Sails, click here. If you’re interested in hiring @sailsbot and her minions in Austin, click here.
Please fix this - getting kind of hard to sails lift every time I change anything...
@erwinsetiawan and @andremaha It is possible to customize your grunt version in Sails V1.
You have to go to the tasks
folder then open config
then open one of the files and it gives you directions on how to go about changing it in 2 steps.
Here's how:
- Install it as a local dependency of your Sails app:
$ npm install grunt-hash --save-dev --save-exact
- Then uncomment the following code:
Load Grunt plugin from the node_modules/ folder. grunt.loadNpmTasks('grunt-hash');
I think It's also documented on the Sails.js website
The sync error is found in sails-hook-grunt/accessible/load-grunt-tasks before it loads any file in the tasks directory. Specifically in the grunt.loadTasks() function when trying to load grunt-sync.
Changing sync.js in the tasks/config doesn't solve this error, even if you delete all files in the tasks directory except tasks/register/default.js, this error still persists.
Edit: I managed to remove the "Loading "sync.js" tasks...ERROR TypeError: Cannot read property 'length' of undefined" error by forking the sails-hook-grunt package, uninstalling the default sails-hook-grunt, installing my forked sails-hook-grunt package, and installing grunt-sync package.
Bump, latest still has issue issue, please fix this.
@erwinsetiawan This may be a problem of using this version of node, but for now I think it's possible to work around it. In your sails project, in the file tasks/sync.js, there are instructions how to customize the grunt dependencies:
Install it as a local dependency of your Sails app:
$ npm install grunt-sync --save-dev --save-exact
Then uncomment the following code: // // Load Grunt plugin from the node_modules/ folder. // grunt.loadNpmTasks('grunt-sync');
@streleck you seems copying on previous comment
The sync error is found in sails-hook-grunt/accessible/load-grunt-tasks before it loads any file in the tasks directory. Specifically in the grunt.loadTasks() function when trying to load grunt-sync.
Changing sync.js in the tasks/config doesn't solve this error, even if you delete all files in the tasks directory except tasks/register/default.js, this error still persists.
Edit: I managed to remove the "Loading "sync.js" tasks...ERROR TypeError: Cannot read property 'length' of undefined" error by forking the sails-hook-grunt package, uninstalling the default sails-hook-grunt, installing my forked sails-hook-grunt package, and installing grunt-sync package.
It worked for me. I'm using your fork to fix the problem.
npm install git+https://github.com/dannysuryadi/sails-hook-grunt.git --save-dev --save-exact
This Environment Info (I'm using docker to run my Sailsjs app):
i have same problem as goin to node 10 lts, im on sails 0.12.4
is there a fix coming ?
i have updated "grunt-sync": "0.8.0", with nodejs 10 and all works ok đź‘Ť
with @streleck it solves the problem but it would be great if within sails the grunt-sync
dependency version was updated đź‘Ť
this is still a problem
@Medioman92 What version of sails and grunt-sync are you using? (Node.js v10 yes?)
sails@1.1.0 grunt-sync@0.6.2 OR grunt-sync@0.8.0 Node 10.5.0
The only solution was a downgrade of node to 10.4.1
@Medioman92 Thanks for confirming this issue (especially that it also occurs on the latest grunt-sync 0.8.0) and confirming the work-around (use Node 10.4.1).
At the moment, there's a Node 10 LTS v10.5.3 that may be worth trying but 10.4.1 is likely the best bet until grunt-sync is specifically updated further.
@erwinsetiawan:
@streleck you seems copying on previous comment
I initially thought the same thing, that he was copying @raqem's solution. However, the answers are slightly different. @raqem is suggesting to use a local version of grunt-task
and @streleck is suggesting to use a local version of grunt-sync
.
In order to use either, they both need to be installed locally and then their respective file in /tasks/config
must be modified by uncommenting the respective line.
i fixed the problem by updating grunt-sync from 0.0.8 to the latest version 0.8.1
@khalid-sb @mikeblume @Medioman92 @johnabrams7 thanks for following up, y'all - we're taking another look at this
We're pretty sure this is fixed in sails-hook-grunt@4 - @rachaelshaw will follow up in just a bit
Ok it is def not fixed in sails-hook-grunt@4 — though that release does get rid of all security vulnerabilities and deprecation notices. Be sure to read the changelog in the sails-hook-grunt repo before updating- you’ll need to remove jst/coffee grunt tasks (or install those dependencies directly- they’ve been removed from core, as far as front-end use)
We’ll keep looking for a solution for node >=10 — it’s probably still just a matter of updating grunt-sync, which we can take care of in sails-hook-grunt itself, but I don’t want to say that until reverifying in case anything changed
@khalid-sb @erwinsetiawan @andremaha @mikeblume @Medioman92 @nicolapalavecino @emps @ZarcoNontol @zhoub @dannysuryadi @raqem @johnabrams7 OK y'all this is fixed in sails-hook-grunt@4.0.1.
To upgrade, in your Sails app, run:
npm install sails-hook-grunt@latest --save-dev
Caution: We don't bundle JST/coffee by default anymore as of sails-hook-grunt@4, so if you were previously on sails-hook-grunt@3.x.x, you'll want to delete tasks/config/jst.js and tasks/config/coffee.js, then search
tasks/
for "jst" and "coffee" and remove the four references to them. (Otherwise if you want to use those things in your front-end code, you can still install them just like you would any grunt dependency-- see the comments at the bottom of the generated files or the Sails docs for more information)
Sails version: 1.0.2 Node version: 10.5.0 NPM version: 6.1.0 DB adapter name: N/A DB adapter version: N/A Operating system: Mac OS
I face problem on grunt task and it only happen on newest nodejs version 10.5.0 and no faced any issue on node 10.4.1 or previous version
Some guy from grunt told me that it already fixed on grunt-sync 0.8.0 but on sails-hook-grunt dependencies still using grunt-sync 0.6.2, so i can't update this dependencies.
So I think need to try upgrade dependencies for sails-hook-grunt.
Thank You