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

bug: exposed methods in @openshift-console/dynamic-plugin-sdk/lib/utils/k8s refer to @console/internal #12255

Open
mikaello opened this issue Nov 8, 2022 · 3 comments
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@mikaello
Copy link
Contributor

mikaello commented Nov 8, 2022

When trying to use functions in @openshift-console/dynamic-plugin-sdk/lib/utils/k8s, the build is failing because it tries to resolve @console/internal. Webpack does not find this module, and hence fails.

A minimal setup reproducing the error:

package.json

{
  "name": "console-bug",
  "version": "1.0.0",
  "description": "Reproduction of bug in package @openshift-console/dynamic-plugin-sdk",
  "main": "index.mjs",
  "dependencies": {
    "@openshift-console/dynamic-plugin-sdk": "0.0.17"
  }
}

index.mjs

import { getReference } from "@openshift-console/dynamic-plugin-sdk/lib/utils/k8s";

console.log(getReference({ group: "group", version: "version", kind: "kind" }))

Install and build with esbuild:

$ npm install
$ npx esbuild index.mjs --bundle
✘ [ERROR] Could not resolve "@console/internal/models"

    node_modules/@openshift-console/dynamic-plugin-sdk/lib/utils/k8s/k8s-utils.js:7:29:
      7 │ const staticModels = require('@console/internal/models');

If you remove the offending line, node_modules/@openshift-console/dynamic-plugin-sdk/lib/utils/k8s/k8s-utils.js:7, it works (both Esbuild and Webpack are happy and the utils I am using works).

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 9, 2023
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 11, 2023
@mikaello
Copy link
Contributor Author

mikaello commented Mar 13, 2023

/remove-lifecycle rotten
/lifecycle frozen

@openshift-ci openshift-ci bot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

2 participants