The problem is that I can't use styles for my application, because any modifications to *.less files cause grunt to fail. Here is what I've got in the terminal:
debug: -------------------------------------------------------
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
Aborted due to warnings.
Running "watch" task
Waiting...
>> File "assets/styles/importer.less" changed.
Loading "sync.js" tasks...ERROR
>> TypeError: Cannot read property 'length' of undefined
Warning: Task "sync:dev" not found.
------------------------------------------------------------------------
error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to resume watching for changes to assets:
error: CTRL+C, then `sails lift`
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and any custom Grunt plugins you're using installed in this project?
error: Run `npm install` if you're not sure.
error:
error: *-> You might have a typo in one of your LESS files, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `/home/user18/Projects/test/t1/.tmp` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R 1000 /home/user18/Projects/test/t1/.tmp
error:
error: *-> If you're still unsure, drop by https://sailsjs.com/support.
Sails version: v1.0.2
Node version: v10.10.0
NPM version: v6.4.1
DB adapter name: N/A
DB adapter version: N/A
Operating system: Ubuntu 18.04.1 LTS
Steps to reproduce:
Hi @viachbiryuk! It looks like you may have removed some required elements from the initial comment template, without which I can't verify that this post meets our contribution guidelines. To re-open this issue, please copy the template from here, paste it at the beginning of your initial comment, and follow the instructions in the text. Then post a new comment (e.g. "ok, fixed!") so that I know to go back and check.
Sorry to be a hassle, but following these instructions ensures that we can help you in the best way possible and keep the Sails project running smoothly.
*If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact [email protected]
I have downgraded nodejs version to 8.12.0 and the issue disappeared ;)
@viachbiryuk Happy to hear you were able to find a solution!
Apparently, this issue is still there with 10.13.0
More background here
Yes I'm still having this issue on node 10.10.0. I am on Windows 10.
I’ll look into it- haven’t done a lot of node 10 testing yet since node 8 is still officially supported for a while yet.
Thank you @mikermcneil !!!
Cheers @mikermcneil. All good now !
@Zaziffic where did you get fixed version from?
Sorry I got carried away, my bad... I still have the problem. I'm staying on the node:8.12.0-stretch for now
Oh haha, no problemo! :)
Downgrading to node v8.12 works. Thanks guys.
try:
// // Load Grunt plugin from the node_modules/ folder.// grunt.loadNpmTasks('grunt-sync');@firmangpi I only needed to uncomment grunt.loadNpmTasks('grunt-sync'); and install grunt-sync locally. That seems to fix the issue if you're using Node v10.x.x, and don't want to downgrade to v8.
I'm currently using v10.15.1
@danielfeelfine @firmangpi
Thanks it worked but only in local and staging, not in production mode.
Is there any further step to fix that in production as well ?
Thanks
Is this fixed in Sails v1.2.2? I'm not sure but it seems like it.
@Noitidart There have been Node 10+ updates for Sails since v1.0.2 mentioned in the original post. Currently not getting the error with Node v11.13.0 & Sails v1.2.2 following the steps to reproduce it. 👍
Just tested this out with the latest version of Sails and Node 10, and still seeing an error from sync:dev (although a slightly different one now):
Aborted due to warnings.
Running "sync:dev" (sync) task
Warning: Cannot read property 'bigint' of undefined
------------------------------------------------------------------------
Will keep looking into this.
Oh I think this is a grunt error right? Maybe Im not seeing this error
because I got rid of grunt.
On Thu, Jun 27, 2019 at 3:19 PM Rachael Shaw notifications@github.com
wrote:
Just tested this out with the latest version of Sails and Node 10, and
still seeing an error from sync:dev (although a slightly different one now):
Aborted due to warnings.
Running "sync:dev" (sync) taskWarning: Cannot read property 'bigint' of undefined
Will keep looking into this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/balderdashy/sails/issues/4513?email_source=notifications&email_token=ABQTZCLBPZMVQ32PXTU5XI3P4U4IBA5CNFSM4FVD4HS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYYRAFI#issuecomment-506531861,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABQTZCOIKC5KZKTA2WZLAFDP4U4IBANCNFSM4FVD4HSQ
.
@viachbiryuk @Noitidart @johnabrams7 actually, once I started looking at it again I realized that my test app had been generated with an older version of Sails after all. (My install of the latest sails wasn't as global as I thought, and when I did sails -v I got 1.0.0-3 which was way before sails-hook-grunt was updated.)
Tried this again with a new app, and triple-checked my versions of Node.js + Sails.js, and couldn't reproduce the issue anymore. Looks like this is fixed now! ✨
@viachbiryuk any new apps you generate should be fine with Node 10 from now on, but if you update sails-hook-grunt in an existing app, be aware that it's on a new major version and you'll need to get rid of any references to the jst and coffee tasks, as those are no longer included by default (unless you are using those, in which case you'll need to install grunt-contrib-jst and grunt-contrib-coffee separately).
Most helpful comment
try:
// // Load Grunt plugin from the node_modules/ folder.// grunt.loadNpmTasks('grunt-sync');from the ./tasks/config/sync.js
hopefully, it will fix this problem