balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.84k stars 1.95k forks source link

Sails hook grunt need to update dependencies grunt-sync #4470

Open erwinsetiawan opened 6 years ago

erwinsetiawan commented 6 years ago

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

Running "watch" task
Waiting...
>> File "assets/styles/project/_colors.scss" changed.
Running "less:dev" (less) task
>> 1 stylesheet created.

Running "sass:dev" (sass) task

Running "sync:dev" (sync) task
Warning: Cannot read property 'bigint' of undefined Use --force to continue.

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

sailsbot commented 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.

andremaha commented 6 years ago

Please fix this - getting kind of hard to sails lift every time I change anything...

raqem commented 6 years ago

@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:

  1. Install it as a local dependency of your Sails app:
    $ npm install grunt-hash --save-dev --save-exact
  2. 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

dannysuryadi commented 6 years ago

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.

zhoub commented 6 years ago

Bump, latest still has issue issue, please fix this.

streleck commented 6 years ago

@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:

  1. Install it as a local dependency of your Sails app:

    $ npm install grunt-sync --save-dev --save-exact

  2. Then uncomment the following code: // // Load Grunt plugin from the node_modules/ folder. // grunt.loadNpmTasks('grunt-sync');

erwinsetiawan commented 6 years ago

@streleck you seems copying on previous comment

ZarcoNontol commented 6 years ago

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):

emps commented 5 years ago

i have same problem as goin to node 10 lts, im on sails 0.12.4

is there a fix coming ?

emps commented 5 years ago

i have updated "grunt-sync": "0.8.0", with nodejs 10 and all works ok đź‘Ť

nicolapalavecino commented 5 years ago

with @streleck it solves the problem but it would be great if within sails the grunt-sync dependency version was updated đź‘Ť

Medioman92 commented 5 years ago

this is still a problem

johnabrams7 commented 5 years ago

@Medioman92 What version of sails and grunt-sync are you using? (Node.js v10 yes?)

Medioman92 commented 5 years ago

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

johnabrams7 commented 5 years ago

@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.

mike-usa commented 5 years ago

@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.

khalid-sb commented 5 years ago

i fixed the problem by updating grunt-sync from 0.0.8 to the latest version 0.8.1

mikermcneil commented 5 years ago

@khalid-sb @mikeblume @Medioman92 @johnabrams7 thanks for following up, y'all - we're taking another look at this

mikermcneil commented 5 years ago

We're pretty sure this is fixed in sails-hook-grunt@4 - @rachaelshaw will follow up in just a bit

mikermcneil commented 5 years ago

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

mikermcneil commented 5 years ago

https://github.com/sailshq/sails-hook-grunt/pull/1

mikermcneil commented 5 years ago

https://stackoverflow.com/questions/51084847/sails-grunt-watch-warning-cannot-read-property-bigint-of-undefined-use-fo/56498514#56498514

mikermcneil commented 5 years ago

@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)