backstage: Scaffolding failing on @gitbeaker dependency

πŸ“œ Description

When i start a newly built plugin, it breaks at the very start

Now using node v18.18.2 (npm v9.8.1)
pmishra7@HCFGQJ690V hackathon-24 % npx @backstage/create-app@latest


? Enter a name for the app [required] backstage

Creating the app...

 Checking if the directory is available:
  checking      backstage βœ” 

 Creating a temporary app directory:

 Preparing files:
  copying       .dockerignore βœ” 
  templating    .eslintrc.js.hbs βœ” 
  templating    .gitignore.hbs βœ” 
  copying       .prettierignore βœ” 
  copying       README.md βœ” 
  copying       app-config.local.yaml βœ” 
  copying       .eslintignore βœ” 
  copying       app-config.production.yaml βœ” 
  templating    app-config.yaml.hbs βœ” 
  templating    backstage.json.hbs βœ” 
  templating    catalog-info.yaml.hbs βœ” 
  copying       playwright.config.ts βœ” 
  copying       tsconfig.json βœ” 
  copying       yarn.lock βœ” 
  templating    package.json.hbs βœ” 
  copying       lerna.json βœ” 
  copying       README.md βœ” 
  copying       entities.yaml βœ” 
  copying       org.yaml βœ” 
  copying       template.yaml βœ” 
  copying       catalog-info.yaml βœ” 
  copying       index.js βœ” 
  copying       package.json βœ” 
  copying       README.md βœ” 
  templating    .eslintrc.js.hbs βœ” 
  copying       Dockerfile βœ” 
  copying       README.md βœ” 
  templating    package.json.hbs βœ” 
  copying       index.ts βœ” 
  copying       types.ts βœ” 
  copying       index.test.ts βœ” 
  copying       auth.ts βœ” 
  copying       app.ts βœ” 
  copying       catalog.ts βœ” 
  copying       proxy.ts βœ” 
  copying       scaffolder.ts βœ” 
  templating    search.ts.hbs βœ” 
  copying       techdocs.ts βœ” 
  copying       .eslintignore βœ” 
  templating    .eslintrc.js.hbs βœ” 
  templating    package.json.hbs βœ” 
  copying       app.test.ts βœ” 
  copying       android-chrome-192x192.png βœ” 
  copying       apple-touch-icon.png βœ” 
  copying       favicon-16x16.png βœ” 
  copying       favicon-32x32.png βœ” 
  copying       favicon.ico βœ” 
  copying       manifest.json βœ” 
  copying       index.html βœ” 
  copying       robots.txt βœ” 
  copying       safari-pinned-tab.svg βœ” 
  copying       App.test.tsx βœ” 
  copying       App.tsx βœ” 
  copying       apis.ts βœ” 
  copying       setupTests.ts βœ” 
  copying       index.tsx βœ” 
  copying       LogoFull.tsx βœ” 
  copying       LogoIcon.tsx βœ” 
  copying       index.ts βœ” 
  copying       Root.tsx βœ” 
  copying       EntityPage.tsx βœ” 
  copying       SearchPage.tsx βœ” 

 Moving to final location:
  moving        backstage βœ” 
  init          git repository β—œ 
 Installing dependencies:
  init          git repository βœ” 
  determining   yarn version βœ” 
  executing     yarn install βœ” 
  executing     yarn tsc βœ” 

πŸ₯‡  Successfully created backstage


 All set! Now you might want to:
  Run the app: cd backstage && yarn dev
  Set up the software catalog: https://backstage.io/docs/features/software-catalog/configuration
  Add authentication: https://backstage.io/docs/auth/

pmishra7@HCFGQJ690V hackathon-24 % cd backstage 
pmishra7@HCFGQJ690V backstage % ls
README.md			app-config.yaml			dist-types			node_modules			playwright.config.ts		yarn.lock
app-config.local.yaml		backstage.json			examples			package.json			plugins
app-config.production.yaml	catalog-info.yaml		lerna.json			packages			tsconfig.json
pmishra7@HCFGQJ690V backstage % yarn dev
yarn run v1.22.19
$ concurrently "yarn start" "yarn start-backend"
$ yarn workspace backend start
$ yarn workspace app start
$ backstage-cli package start
$ backstage-cli package start
[0] Loaded config from app-config.yaml
[0] <i> [webpack-dev-server] Project is running at:
[0] <i> [webpack-dev-server] Loopback: http://localhost:3000/, http://127.0.0.1:3000/
[0] <i> [webpack-dev-server] Content not from webpack is served from '/Users/pmishra7/Documents/repos/hackathon-24/backstage/packages/app/public' directory
[0] <i> [webpack-dev-server] 404s will fallback to '/index.html'
[0] <i> [webpack-dev-middleware] wait until bundle finished: /
[1] node:internal/modules/cjs/loader:1098
[1]   const err = new Error(`Cannot find module '${request}'`);
[1]               ^
[1] 
[1] Error: Cannot find module '/Users/pmishra7/Documents/repos/hackathon-24/backstage/node_modules/@gitbeaker/rest/dist/index.js'
[1]     at createEsmNotFoundErr (node:internal/modules/cjs/loader:1098:15)
[1]     at finalizeEsmResolution (node:internal/modules/cjs/loader:1091:15)
[1]     at resolveExports (node:internal/modules/cjs/loader:567:14)
[1]     at Module._findPath (node:internal/modules/cjs/loader:636:31)
[1]     at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
[1]     at a._resolveFilename (/Users/pmishra7/Documents/repos/hackathon-24/backstage/node_modules/tsx/dist/cjs/index.cjs:1:1729)
[1]     at Module._load (node:internal/modules/cjs/loader:922:27)
[1]     at Module.require (node:internal/modules/cjs/loader:1143:19)
[1]     at require (node:internal/modules/cjs/helpers:119:18)
[1]     at Object.<anonymous> (/Users/pmishra7/Documents/repos/hackathon-24/backstage/node_modules/@backstage/plugin-scaffolder-backend-module-gitlab/dist/index.cjs.js:9:12)
[1]     at Module._compile (node:internal/modules/cjs/loader:1256:14)
[1]     at Object.S (/Users/pmishra7/Documents/repos/hackathon-24/backstage/node_modules/tsx/dist/cjs/index.cjs:1:1292)
[1]     at Module.load (node:internal/modules/cjs/loader:1119:32)
[1]     at Module._load (node:internal/modules/cjs/loader:960:12)
[1]     at Module.require (node:internal/modules/cjs/loader:1143:19)
[1]     at require (node:internal/modules/cjs/helpers:119:18) {
[1]   code: 'MODULE_NOT_FOUND',
[1]   path: '/Users/pmishra7/Documents/repos/hackathon-24/backstage/node_modules/@gitbeaker/rest/package.json'
[1] }
[1] 
[1] Node.js v18.18.2
[0] webpack compiled successfully
^C[0] <i> [webpack-dev-server] Gracefully shutting down. To force exit, press ^C again. Please wait...

pmishra7@HCFGQJ690V backstage % [1] yarn start-backend exited with code SIGINT
[0] yarn start exited with code SIGINT
nvm ^C
pmishra7@HCFGQJ690V backstage % npm --version
9.8.1
pmishra7@HCFGQJ690V backstage % node --version
v18.18.2

Similar issue: https://github.com/backstage/backstage/issues/5980

πŸ‘ Expected behavior

Should start the application

πŸ‘Ž Actual Behavior with Screenshots

image

πŸ‘Ÿ Reproduction steps

npx @backstage/create-app@latest
cd backstage
yarn dev

πŸ“ƒ Provide the context for the Bug.

No response

πŸ–₯️ Your Environment

No response

πŸ‘€ Have you spent some time to check if this bug has been raised before?

  • I checked and didn’t find similar issue

🏒 Have you read the Code of Conduct?

Are you willing to submit PR?

None

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Reactions: 6
  • Comments: 28 (4 by maintainers)

Most upvoted comments

@giocolas That’s because the team behind that library released a fixed version.

Thanks @awanlin , @jdalrymple . This is working now!!! Will post here if i find any further issues.

The issue was a pipeline problem, not a code problem, but ill keep an eye out throughout the day just in case you guys notice anything awry

No worries, sorry going back to older versions of the various @gitbeaker packages. But I really don’t know if that’s going to help 😦

adding resolutions partially fix the problem

i need to add all 3 libs to fix missing file problem

 "resolutions": {
   ...
    "@gitbeaker/core": "39.33.0",
    "@gitbeaker/rest": "39.33.0",
    "@gitbeaker/requester-utils": "39.33.0"
  }

but now there is another one

/node_modules/@gitbeaker/requester-utils/dist/index.js:99
[1]   Object.entries(resources).filter(([, s]) => typeof s === "function").forEach(([k, r]) => {
[1]          ^
[1] 
[1] TypeError: Cannot convert undefined or null to object
[1]     at Function.entries (<anonymous>)
[1]     at Object.presetResourceArguments (/node_modules/@gitbeaker/requester-utils/dist/index.js:99:10)
[1]     at Object.<anonymous> (/node_modules/@gitbeaker/node/src/index.ts:5:13)