microsoft / azure-devops-extension-sample

Sample web extension for Azure DevOps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with package-extension on npm run build script

v-paumur opened this issue · comments

Due to security concerns we updated to Node.js v14 and then tried to compile an extension we already have running on Azure Devops. However, it does not compile as there is an incompatibility issue with itemProvider on the Table components that didn't exist before, possibly related to ArrayItemProvider. I know that is a different team and not the focal point here, just background info.

As a result, I tried cloning this solution to see if the same issue exists. It doesn't as the Table sample is basic. But...

Upon attempting to run the solution, I am getting an error when the npm script tries to run package-extension.

(node:22580) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
TFS Cross Platform Command Line Interface v0.6.4
Copyright Microsoft Corporation
error: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Inplace
npm ERR! code 4294967295

running the trace:

internal/modules/cjs/loader.js:888
  throw err;
  ^

Error: Cannot find module 'D:\azure-devops-extension-sample\...'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Running the following directly from the terminal prompt works, just not part of the build command.

  • webpack --mode production
  • tfx extension create --manifest-globs azure-devops-extension.json src/Samples/**/*.json "--rev-version"
  • C:\WINDOWS\system32\cmd.exe /d /s /c tfx extension create --manifest-globs azure-devops-extension.json src/Samples/**/*.json "--rev-version"

Any ideas?

Unfortunately this doesn't work with node 14, check this: #65

v13 and v14 didn't work for me. I had to install v10.

The good news is that this bug is fixed in latest tfx-cli. So update your tfx-cli dependency in package.json and you can run on the latest Node.
"tfx-cli": "^0.10.0"
and then run npm install