pnp / generator-teams

A Yeoman Generator for Microsoft Teams
https://pnp.github.io/generator-teams
MIT License
428 stars 112 forks source link

TypeError in plugin "yoteams-build.core"Bug report: <short description> #366

Open Migwados opened 1 year ago

Migwados commented 1 year ago

Description

When I'm trying to run 'gulp ngrok-serve' it's coming back with

[14:38:12] Found additional Yo Teams plugin: yoteams-deploy [14:38:12] Using gulpfile C:\Temp\Bots\Project\gulpfile.js [14:38:12] Starting 'ngrok-serve'... [14:38:12] Starting 'start-ngrok'... [14:38:12] [NGROK] starting ngrok... [14:38:14] 'start-ngrok' errored after 2.04 s [14:38:14] TypeError in plugin "yoteams-build.core" Message: Cannot read properties of undefined (reading 'body') [14:38:14] Finished 'ngrok-serve' after 2.06 s

Steps to reproduce

Gulp file is as follows;

/ eslint-disable eol-last / // Copyright (c) Wictor Wilén. All rights reserved. // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license.

const gulp = require("gulp"); const package = require("./package.json"); const argv = require("yargs").argv; const log = require("fancy-log"); const path = require("path");

const config = {};

// Set environment variables const env = argv.env; if (env === undefined) { require("dotenv").config(); } else { log(Using custom .env: ${env}); require("dotenv").config({ path: path.resolve(process.cwd(), env) }); } process.env.VERSION = package.version;

const core = require("yoteams-build-core");

// Initialize core build core.setup(gulp, config);

// Add your custom or override tasks below

Expected results

Up until about 2 weeks ago, the server name was generated and it worked fine. I did have a problem with Zscaler, but I turned it off and that solved the issue. Zscaler is still turned off, but this issue seems to point more to the scripting than anything else...

Actual results

TypeError in plugin "yoteams-build.core" Message: Cannot read properties of undefined (reading 'body')

Project you experience issues with

yoteams-build-core

generator version

4.1.0

build tools version

1.8.0

nodejs version

v18.16.0

npm version

9.6.7

Operating system (environment)

Windows

Additional Info

No response

iyyoo93 commented 1 year ago

Facing the same issue with mac as well

Migwados commented 1 year ago

Sounds like it could have something to do with the previous post, too https://github.com/pnp/generator-teams/issues/364

PragashVenu commented 1 year ago

Facing the same issue with windows

image

nodejs version v18.16.0 ngrok version 2.3.41 npm: '9.5.1'

Kowleone commented 1 year ago

Same here, I'm following the MS Build Challenge material for MS-600 and cannot progress with the 'Planet bot' excersize on MS learn due to this bug.

stephanbisser commented 1 year ago

Thanks for reporting this, we'll look into this asap and fix it!

Kowleone commented 1 year ago

@stephanbisser

The ngrok error only happens for me on the 'Planet Teams' app creation excerise. - The first in the MS build challenge content.

The next module for the 'tab' exercise has no issues with ngrok serve! - https://learn.microsoft.com/en-us/training/modules/embedded-web-experiences/3-exercise-create-custom-teams-personal-tab.

However, i noticed another potentail bug (or user error on my part?). The gulp manifest task isn't creating a package.zip for upload via teams. Screenshot 2023-06-09 173747 Screenshot 2 2023-06-09 173850 Screenshot 3 2023-06-09 173747

I Hope this can be resolved soon as the build challange is on a timer and has only 10 days left. Thanks for your support ;)

iseliweb commented 1 year ago

Any update on this or any kind of workaround? Any combination of any version leads to the same issue, even using earlier versions of all modules.

xavierhamel commented 1 year ago

This issue is probably linked with this issue from ngork bubenshchykov/ngrok#309.

The error occurs because error.response.body is not defined (in ngork/src/client.js at line 40). Which means an error occured, you just don't get why the error occured:

          clientError = new NgrokClientError(
            error.response.body, // <---- here
            error.response,
            error.response.body
          );

For me the acutal errors were HTTPError: Response code 503 and RequestError: connect ECONNREFUSED.

Hope this helps!

xavierhamel commented 1 year ago

After more digging, yoteams-build-core uses ngrok v4.0.1 which does not work anymore because it uses ngrok 2 which is not supported anymore for anonymous user:

Your ngrok agent version "2" is no longer supported. Only the most recent version of the ngrok agent is supported without an account.

I upgraded the package to v5.0.0-beta.2 and added my account and it does seem to work. The npm overrides can be used for that porpuse.

The documentation or the package should be updated accordingly as it does not seems to work as is for now.

skhemka007 commented 10 months ago

upgraded the ngrok package to v5.0.0-beta.2 but still not resolved. Do we have any work-around??

hpv333 commented 7 months ago

the upgraded version didn't work for me either , Any other ways?

9swampy commented 5 months ago

Upgrades hasn't helped. Any update?

abhilasha007 commented 5 months ago

Update did not fix, Any update/ help?

nicodecleyre commented 2 months ago

Stumbled on this issue while using the Teams App Generator and can confirm what @xavierhamel is saying.

I updated ngrok for the yoteams-build-core module. So running npm i ngrok@5.0.0-beta.2 from within the node_modules/yoteams-build-core folder, not from the root folder of your solution.

Next i created an account at ngrok.com and put my authtoken in my ngrok.yml file which is situated at C:\Users\Me\.ngrok2 so it looks like this:

version: "3"
agent:
  authtoken: <Your Auth Token>

After that, gulp start-ngrok or gulp ngrok-serve works like a charm