microsoft / CopilotStudioSamples

MIT License
235 stars 211 forks source link

SharePoint SSO Component deployment fails using Azure DevOps #208

Open mohammadamer opened 1 month ago

mohammadamer commented 1 month ago

What sample tool are you using? SharePoint SSO Component

Describe the bug I'm having issue to deploy SharePoint SSO Component sample using Azure DevOps when using VM ubunto-latest

To Reproduce Steps to reproduce the behavior: add the yaml file required to automate the sample deployment in Azure DevOps using ubuntu-latest VM

stages:
  - stage:
    displayName: build
    jobs:
      - job:
        displayName: build
        pool:
          vmImage: ubuntu-latest
          demands:
            - npm
            - node.js
            - java

Expected behavior Expected to get the sample build smoothly as it was build locally

Screenshots Error:

Error - [webpack] 'dist':
./node_modules/micromark-util-decode-numeric-character-reference/index.js 23:11
Module parse failed: Identifier directly after number (23:11)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   code > 126 && code < 160 ||
|   // Lone high surrogates and low surrogates.
>   code > 55_295 && code < 57_344 ||
|   // Noncharacters.
|   code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */
 @ ./node_modules/mdast-util-from-markdown/lib/index.js 138:0-97 1061:14-45
 @ ./node_modules/mdast-util-from-markdown/index.js
 @ ./node_modules/botframework-webchat-component/lib/Attachment/Text/private/LinkDefinitions.js
 @ ./node_modules/botframework-webchat-component/lib/Attachment/Text/private/MarkdownTextContent.js
 @ ./node_modules/botframework-webchat-component/lib/Attachment/Text/TextContent.js
 @ ./node_modules/botframework-webchat-component/lib/index.js
 @ ./node_modules/botframework-webchat/lib/addVersion.js
 @ ./node_modules/botframework-webchat/lib/index.js
 @ ./lib/extensions/copilotComponent/components/ChatBot.js
 @ ./lib/extensions/copilotComponent/CopilotComponentApplicationCustomizer.js
./node_modules/micromark-util-sanitize-uri/index.js 86:22
Module parse failed: Identifier directly after number (86:22)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     }
|     // Astral.
>     else if (code > 55_295 && code < 57_344) {
|       const next = value.charCodeAt(index + 1)
|
 @ ./node_modules/micromark/lib/compile.js 44:0-55 770:10-21 781:10-21 1089:8-19 1105:22-33
 @ ./node_modules/micromark/index.js
 @ ./node_modules/mdast-util-from-markdown/lib/index.js
 @ ./node_modules/mdast-util-from-markdown/index.js
 @ ./node_modules/botframework-webchat-component/lib/Attachment/Text/private/LinkDefinitions.js
 @ ./node_modules/botframework-webchat-component/lib/Attachment/Text/private/MarkdownTextContent.js
 @ ./node_modules/botframework-webchat-component/lib/Attachment/Text/TextContent.js
 @ ./node_modules/botframework-webchat-component/lib/index.js
 @ ./node_modules/botframework-webchat/lib/addVersion.js
 @ ./node_modules/botframework-webchat/lib/index.js
 @ ./lib/extensions/copilotComponent/components/ChatBot.js
 @ ./lib/extensions/copilotComponent/CopilotComponentApplicationCustomizer.js
./node_modules/htmlparser2/lib/esm/index.js 48:9
Module parse failed: Unexpected token (48:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|  * They should probably be removed eventually.
|  */
> export * as ElementType from "domelementtype";
| import { getFeed } from "domutils";
| export { getFeed } from "domutils";
 @ ./node_modules/sanitize-html/index.js 1:19-41
 @ ./node_modules/botframework-webchat/lib/markdown/renderMarkdown.js
 @ ./node_modules/botframework-webchat/lib/index.js
 @ ./lib/extensions/copilotComponent/components/ChatBot.js
 @ ./lib/extensions/copilotComponent/CopilotComponentApplicationCustomizer.js

Additional context It gets build if I change the VM to be windows-latest

adilei commented 1 month ago

Is your pipeline running gulp? gulpfile.js specifies that babel-loader should be used.

'use strict';

const build = require('@microsoft/sp-build-web');

build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);

var getTasks = build.rig.getTasks;
build.rig.getTasks = function () {
  var result = getTasks.call(build.rig);

  result.set('serve', result.get('serve-deprecated'));

  return result;
};

build.configureWebpack.mergeConfig({
  additionalConfiguration: (generatedConfiguration) => {
    generatedConfiguration.module.rules.push(
      {
        test: /\.js$/,
        exclude: /node_modules\/(?!htmlparser2)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env']
          }
        }
      }
    );

    return generatedConfiguration;
  }
});

build.initialize(require('gulp'));
mohammadamer commented 1 month ago

Yep, it has these tasks specifies that babel-loader should be used.

adilei commented 1 month ago

Got it. Not sure why it wouldn't run on an Ubuntu VM. Does it build on the same VM manually?

mohammadamer commented 1 month ago

I can't run it the VM manually because the VM is provisioned by Azure DevOps and the process is automated. The thing is that Windows VM is taking long time to complete the build process compared to Ubuntu VM that's why we are aiming to use Ubuntu VM instead of Windows VM in the Build process.

adilei commented 1 month ago

Understood. Unfortunately, I don't have a way to test this right now.

mohammadamer commented 1 month ago

Ok, No worries! take your time.

mohammadamer commented 1 month ago

Hey! I managed to install Ubuntu 24.04 on my Win11 pc and then got another build errors on Ubuntu. But with Ubuntu 22.04 build was successful. I'm wondering why in Azure DevOps pipeline I have build errors.

You can maybe try using this approach then see if you will get the same or not.

[17:04:52] Starting 'build'...
[17:04:52] Starting gulp
[17:04:52] Starting subtask 'pre-copy'...
[17:04:52] Finished subtask 'pre-copy' after 9.79 ms
[17:04:52] Starting subtask 'copy-static-assets'...
[17:04:52] Starting subtask 'sass'...
[17:04:53] Finished subtask 'sass' after 717 ms
[17:04:53] Starting subtask 'lint'...
[17:04:53] [lint] eslint version: 8.7.0
[17:04:53] Starting subtask 'tsc'...
[17:04:53] [tsc] typescript version: 4.7.4
[17:04:53] Finished subtask 'copy-static-assets' after 890 ms
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2128,27): error TS1139: Type parameter declaration expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2128,42): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2128,65): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2128,74): error TS1005: ')' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2128,94): error TS1109: Expression expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2128,108): error TS1005: ';' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2128,109): error TS1128: Declaration or statement expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2161,32): error TS1139: Type parameter declaration expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2161,47): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2161,70): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2161,79): error TS1005: ')' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2161,99): error TS1109: Expression expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2161,113): error TS1005: ';' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(2161,114): error TS1128: Declaration or statement expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,55): error TS1139: Type parameter declaration expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,71): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,85): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,95): error TS1109: Expression expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,147): error TS1005: ')' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,166): error TS1005: ';' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,168): error TS1434: Unexpected keyword or identifier.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,177): error TS1128: Declaration or statement expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3328,178): error TS1128: Declaration or statement expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,65): error TS1139: Type parameter declaration expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,81): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,95): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,105): error TS1109: Expression expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,149): error TS1109: Expression expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,184): error TS1005: ')' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,203): error TS1005: ';' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,205): error TS1434: Unexpected keyword or identifier.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,214): error TS1128: Declaration or statement expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(3347,215): error TS1128: Declaration or statement expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,58): error TS1139: Type parameter declaration expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,77): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,92): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,103): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,106): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,114): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,131): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,144): error TS1005: ')' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,168): error TS1109: Expression expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,182): error TS1005: ';' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5153,183): error TS1128: Declaration or statement expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,58): error TS1139: Type parameter declaration expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,77): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,92): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,103): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,106): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,114): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,131): error TS1005: ',' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,144): error TS1005: ')' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,168): error TS1109: Expression expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,182): error TS1005: ';' expected.
[17:04:56] Error - [tsc] node_modules/botframework-webchat-core/node_modules/valibot/dist/index.d.ts(5313,183): error TS1128: Declaration or statement expected.
[17:04:56] Error - 'tsc' sub task errored after 2.97 s
 exited with code 2
[17:04:56] 'build' errored after 3.79 s
[17:04:56]
About to exit with code: 1