Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Not Found in new Backend system #118

Open
tam-pham-ts opened this issue Aug 13, 2024 · 1 comment
Open

Module Not Found in new Backend system #118

tam-pham-ts opened this issue Aug 13, 2024 · 1 comment

Comments

@tam-pham-ts
Copy link

tam-pham-ts commented Aug 13, 2024

Hi team, I face an issue when installing backstage-plugin-harbor-backend package.
I follow the installation guide:

yarn --cwd packages/backend add @bestsellerit/backstage-plugin-harbor-backend

Installation result:

success Saved lockfile.
warning Workspaces can only be enabled in private projects.
success Saved 3 new dependencies.
info Direct dependencies
info All dependencies
├─ @bestsellerit/backstage-plugin-harbor-backend@0.3.2
├─ @types/scheduler@0.16.8
└─ app@0.0.0
✨  Done in 22.88s.

But when running the backstage application

yarn dev

It throws an error

[1] Error: Cannot find module '@bestsellerit/backstage-plugin-harbor-backend'
[1] Require stack:
[1] - /Users/tam.pham/Desktop/TrustingSocial/XPLATFORM/backstage/packages/backend/src/index.ts
[1]     at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
[1]     at Module._load (node:internal/modules/cjs/loader:984:27)
[1]     at Module.require (node:internal/modules/cjs/loader:1231:19)
[1]     at require (node:internal/modules/helpers:179:18)
[1]     at <anonymous> (/Users/tam.pham/Desktop/TrustingSocial/XPLATFORM/backstage/packages/backend/src/index.ts:49:13)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[1]   code: 'MODULE_NOT_FOUND',
[1]   requireStack: [
[1]     '/Users/tam.pham/Desktop/TrustingSocial/XPLATFORM/backstage/packages/backend/src/index.ts'
[1]   ]
[1] }
[1] 
[1] Node.js v20.12.2
[1] 
[1] Change detected, restarting the development server...
[1] 
[1] (node:32187) Warning: Accessing non-existent property 'HostDiscovery' of module exports inside circular dependency
[1] (Use `node --trace-warnings ...` to show where the warning was created)
[1] (node:32187) Warning: Accessing non-existent property 'HostDiscovery' of module exports inside circular dependency
[1] node:internal/modules/cjs/loader:1143
[1]   const err = new Error(message);
[1]               ^
[1] 
[1] Error: Cannot find module '@bestsellerit/backstage-plugin-harbor-backend'
[1] Require stack:
[1] - /Users/tam.pham/Desktop/TrustingSocial/XPLATFORM/backstage/packages/backend/src/index.ts
[1]     at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
[1]     at Module._load (node:internal/modules/cjs/loader:984:27)
[1]     at Module.require (node:internal/modules/cjs/loader:1231:19)
[1]     at require (node:internal/modules/helpers:179:18)
[1]     at <anonymous> (/Users/tam.pham/Desktop/TrustingSocial/XPLATFORM/backstage/packages/backend/src/index.ts:49:13)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[1]   code: 'MODULE_NOT_FOUND',
[1]   requireStack: [
[1]     '/Users/tam.pham/Desktop/TrustingSocial/XPLATFORM/backstage/packages/backend/src/index.ts'
[1]   ]
[1] }

My Backstage version: 1.30.0-next.3

@mikkeschiren
Copy link
Contributor

The npm package published doesn't support the new backend. You need a newer version, and you could use this package instead: https://www.npmjs.com/package/@digitalist-open-cloud/backstage-plugin-harbor-backend. Also follow how to add the backend to packages/backend/src/index.ts (see README in that package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants