How do I fix gulpfile.js to avoid "Did you forget to signal async completion?" when running "gulp ngrok-serve" and DO NOT have the task defined? - gulp

I used 2 tutorial clips from Microsoft (first, second) to build a sample Teams Message Extension.
I'm down to the final step of really starting the app with the gulp ngrok-serve command, but I get this error message:
...
[16:05:29] Watching .env
[16:05:29] The following tasks did not complete: ngrok-serve, serve, watch
[16:05:29] Did you forget to signal async completion?
I've read various suggestions on how to fix this, but the problem in my case is that I don't have the "ngrok-serve" task defined in my file. It seems to be running a "default" version of it.
So how should I define/overwrite it, so that I can fix it's implementation, in my gulpfile.js file ?
Thank you.

We were able to run the app successfully using gulp serve, as mentioned in the Build your first Microsoft Teams app using the Yeoman generator documentation. Please run the app using gulp serve.

Related

Gulp File Task never defined: licenses

I am trying to deploy my react app on netlify and the log gives me this error.
Belowe here is the gulpfile , Anyone knows why this error occurs? Thanks!
I think this is because the task() API is not recommended any more.
Try to export your tasks instead. https://gulpjs.com/docs/en/getting-started/creating-tasks

Gulp bundle --ship: The build failed because a task wrote output to stderr

I've been getting this error when trying to do a gulp bundle --ship command:
The build failed because a task wrote output to stderr.
Exiting with exit code: 1
I'm pretty new to this so have no idea how to proceed with it. It's happening even when I run through the helloworld webpart now. The gulp serve works and I can bundle and package the solution as long as I don't add a --ship to it. I've written and published apps before on the same machine so I don't know what is different now.
I've uninstalled every extension and re-installed the application but it's still doing it. Any help would be appreciated.
Just for quick win you can use --debug flag for bundling task instead of --ship until this bug will be fixed in future releases:
gulp bundle --debug
gulp package-solution --ship
The bundled file will be bigger, but at least you are not getting "The build failed because a task wrote output to stderr" error in CI/CD.
It normally happens because of the warnings. You can add suppression like mentioned below in gulpfile.js
build.addSuppression(Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.);
build.addSuppression(/Warning/gi);
I got this error because caniuse-lite needed a database update. It was confusing because there was no red error message.
Easy fix: npx browserslist#latest --update-db

Is gulp made for fast deployment to remote server using the "dist" directory

I have started to learn Gulp.
It is nice, and now I have a dist folder, which is probably useless if I do not have a straight-forward method to put it on server.
Is there a way that Gulp will handle it for me, taking in concern to upload ONLY those files that modified or newly created? (In order to save upload time, sure).
I am working with Node.js.
Thanks.
how do you normally deploy to production? If you use ftp - there is a gulp function for that. If you use AWS S3 - there is a function for that. If you use something like docker or AWS EB, then you will continue to deploy through git etc - there is also likely to be a gulp function for this. Gulp is just a tool to process files and make build/deployment tasks easier.
Pulled straight from gulp website:
gulp is a toolkit for automating painful or time-consuming tasks in your development workflow, so you can stop messing around and build something.

No gulp file found (windows)

have a problem with gulp. I've been using gulp for 3 months. And for the first time a have an issue like this:
When I try to run gulp, command line shows: no gulp file found. I use node, and I got project from my friend to fix code. Thank, U!
gulp is telling you that it doesn't have a gulpfile with instructions for it to follow. Please make sure you were in correct directory that contains gulpfile.js. It will be better if you could show your project structure here.

Strange gulp "Directory does not exist" error?

I have checked out a repo, run npm install and tried to run Gulp but I get this error:
[16:33:00] Directory "/Users/myname/project/folder/web/js-tasks" does
not exist.
If in the terminal I go cd /Users/myname/project/folder/web/js-tasks then it takes me to that directory with no problem. Ive tried running the gulp task as sudo incase its permission but I get the same result.
The gulpfile.js is at ~project/folder/web. I am on a mac and I am using Vagrant. I am trying to run this from the host machine but if I SSH into my Vagrant machine, cd to where the gulpfile.js is and run gulp log I get a similar error Directory "/web/js-tasks" does not exist.
Many times when I faced problems with gulp scripts - I use WebStorm IDE to debug them.
Fortunately WebStorm have debug feature for gulp tasks.
After you set breakpoint in your gulpfile.js, you need to:
Open Gulp panel in WebStorm
Right click on task you need to debug
Click "Debug ..." in context menu
When debugger stops on breakpoint you can manually check how Gulp "see" your file system by evaluating JS expression fs.readdirSync("/Users/myname/project/folder/web/js-tasks") in "Watches" panel.
It turns out whenever there is any error in the gulp file that stops it running then I get this message instead of a proper error message.