Azure / api-management-developer-portal

Developer portal provided by the Azure API Management service.
MIT License
488 stars 318 forks source link

Typescript Errors on Update from 2.11 to 2.18.1 #1873

Closed robbinscp closed 3 months ago

robbinscp commented 2 years ago

Bug description

When attempting to run an update from 2.11 to 2.18.1, we're getting the following Typescript errors. We've followed this this document for deployment. We've also tried to do this with previous releases (2.18, 2.17) with no luck. Is there an update process that we've missed that we aren't following?

Starting: npm run publish
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.201.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
npm run publish
========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/60d83bb4-5739-40b8-8b89-5a1188f7822c.sh

> apim-developer-portal@2.11.0 publish
> webpack --config webpack.publisher.js && node dist/publisher/index.js && npm run serve-website

asset ./index.js 14.2 MiB [emitted] (name: index)
asset editors/templates/default.json 82.2 KiB [emitted] [from: templates/default.json] [copied]
asset config.json 198 bytes [emitted] [from: src/config.publish.json] [copied]
asset assets/config.json 175 bytes [emitted] [from: src/config.runtime.json] [copied]
orphan modules 70.4 KiB [orphan] 50 modules
runtime modules 1.37 KiB 6 modules
modules by path ./node_modules/ 11.5 MiB
  javascript modules 10.6 MiB 1849 modules
  json modules 927 KiB
    modules by path ./node_modules/whatwg-encoding/ 92.2 KiB 10 modules
    modules by path ./node_modules/cheerio/ 30 KiB 4 modules
    modules by path ./node_modules/cheerio-select/ 30 KiB 4 modules
    modules by path ./node_modules/jsdom/ 133 KiB 3 modules
    + 6 modules
modules by path ./src/ 292 KiB 181 modules
+ 25 modules

WARNING in ./node_modules/ws/lib/buffer-util.js 103:21-42
Module not found: Error: Can't resolve 'bufferutil' in '/home/vsts/work/1/s/node_modules/ws/lib'
 @ ./node_modules/ws/lib/websocket.js 31:21-45
 @ ./node_modules/ws/index.js 3:18-44
 @ ./node_modules/jsdom/lib/jsdom/living/websockets/WebSocket-impl.js 7:18-31
 @ ./node_modules/jsdom/lib/jsdom/browser/Window.js 21:22-83
 @ ./node_modules/jsdom/lib/api.js 13:25-61
 @ ./node_modules/@paperbits/common/publishing/dominoHtmlDocumentProvider.ts 4:16-32
 @ ./node_modules/@paperbits/common/publishing/index.ts 27:13-52
 @ ./node_modules/@paperbits/core/core.publish.module.ts 11:21-60
 @ ./src/startup.publish.ts 7:30-76

WARNING in ./node_modules/ws/lib/validation.js 109:22-47
Module not found: Error: Can't resolve 'utf-8-validate' in '/home/vsts/work/1/s/node_modules/ws/lib'
 @ ./node_modules/ws/lib/receiver.js 13:43-66
 @ ./node_modules/ws/index.js 7:21-46
 @ ./node_modules/jsdom/lib/jsdom/living/websockets/WebSocket-impl.js 7:18-31
 @ ./node_modules/jsdom/lib/jsdom/browser/Window.js 21:22-83
 @ ./node_modules/jsdom/lib/api.js 13:25-61
 @ ./node_modules/@paperbits/common/publishing/dominoHtmlDocumentProvider.ts 4:16-32
 @ ./node_modules/@paperbits/common/publishing/index.ts 27:13-52
 @ ./node_modules/@paperbits/core/core.publish.module.ts 11:21-60

+ 4 assets
Entrypoint scripts/theme 12 MiB = ./scripts/theme.js
Entrypoint styles/theme 77.4 KiB = styles/theme.css 75.2 KiB ./styles/theme.js 2.22 KiB
orphan modules 132 KiB (javascript) 975 bytes (runtime) [orphan] 45 modules
runtime modules 1.52 KiB 7 modules
modules by path ./node_modules/ 8.03 MiB
  javascript modules 7.94 MiB 2022 modules
  json modules 91.3 KiB
    modules by path ./node_modules/cheerio/ 30 KiB 4 modules
    modules by path ./node_modules/cheerio-select/ 30 KiB 4 modules
    modules by path ./node_modules/entities/ 30 KiB 4 modules
    ./node_modules/truncate-html/node_modules/cheerio/package.json 1.05 KiB [built] [code generated]
    ./node_modules/css-select/lib/procedure.json 126 bytes [built] [code generated]
modules by path ./src/ 1.13 MiB (javascript) 74.6 KiB (css/mini-extract) 209 modules
./environmentConstants.js 92 bytes [built] [code generated]
safe-buffer (ignored) 15 bytes [built] [code generated]
readable-stream (ignored) 15 bytes [built] [code generated]

ERROR in /home/vsts/work/1/s/src/components/users/signin/ko/signinViewModelBinder.ts
5:31-71
[tsl] ERROR in /home/vsts/work/1/s/src/components/users/signin/ko/signinViewModelBinder.ts(5,32)
      TS2307: Cannot find module '../../../../contracts/identitySettings' or its corresponding type declarations.

ERROR in /home/vsts/work/1/s/src/components/users/signin-social/ko/signinSocialViewModelBinder.ts
6:31-71
[tsl] ERROR in /home/vsts/work/1/s/src/components/users/signin-social/ko/signinSocialViewModelBinder.ts(6,32)
      TS2307: Cannot find module '../../../../contracts/identitySettings' or its corresponding type declarations.

ERROR in /home/vsts/work/1/s/src/components/users/signup/ko/signupViewModelBinder.ts
5:31-71
[tsl] ERROR in /home/vsts/work/1/s/src/components/users/signup/ko/signupViewModelBinder.ts(5,32)
      TS2307: Cannot find module '../../../../contracts/identitySettings' or its corresponding type declarations.

ERROR in /home/vsts/work/1/s/src/components/users/signup-social/ko/signupSocialViewModelBinder.ts
4:31-71
[tsl] ERROR in /home/vsts/work/1/s/src/components/users/signup-social/ko/signupSocialViewModelBinder.ts(4,32)
      TS2307: Cannot find module '../../../../contracts/identitySettings' or its corresponding type declarations.

ERROR in /home/vsts/work/1/s/src/services/identityService.ts
./src/services/identityService.ts 5:40-71
[tsl] ERROR in /home/vsts/work/1/s/src/services/identityService.ts(5,41)
      TS2307: Cannot find module '../contracts/identitySettings' or its corresponding type declarations.
 @ ./src/services/index.ts 23:13-41
 @ ./src/apim.runtime.module.ts 69:19-40
 @ ./src/startup.runtime.ts 6:30-62

5 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.73.0 compiled with 5 errors in 68580 ms
##[error]Bash exited with code '1'.
Finishing: npm run publish

Reproduction steps

  1. Run ADO pipeline
  2. Monitor output and view failure for npm run publish

Expected behavior

Deployment should succeed without issues

Is your portal managed or self-hosted?

Self-hosted

Release tag or commit SHA (if using self-hosted version)

release 2.18.1 / 89f08c5

API Management service name

chartermfgdevuscapim

Environment

Additional context

N/A

ghost commented 2 years ago

@robbinscp, thank you for opening this issue. We will triage it within the next few business days.

azaslonov commented 2 years ago

@robbinscp, there is no specific process. Are you able to run it locally, without ADO? Just in case, there is a few things you can do to have a clean start:

  1. git fetch - ensures you've got latest updates
  2. git reset --hard origin/master - resets the content to current master branch state
  3. git clean -xdf - removes everything from file system that is not in the repository.
  4. npm install - restores packages.
  5. After all this you need to place your *.config.json files back.
  6. npm run publish - publishes locally.