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

extensions using npm package with dependency on http leads to crash #7833

Closed
axel7083 opened this issue Jun 26, 2024 · 5 comments · Fixed by #7850
Closed

extensions using npm package with dependency on http leads to crash #7833

axel7083 opened this issue Jun 26, 2024 · 5 comments · Fixed by #7850
Assignees
Labels
kind/bug 🐞 Something isn't working

Comments

@axel7083
Copy link
Contributor

axel7083 commented Jun 26, 2024

Bug description

image

error is raised here

throw Error(`Cannot find extension for ${parent.path}`);

Operating system

Windows 11

Installation Method

Other

Version

next (development version)

Steps to reproduce

Add @kubernetes/client-node npm package to any extensions, import it and use it (avoid tree shaking).

Relevant log output

No response

Additional context

cc @benoitf

@axel7083 axel7083 added the kind/bug 🐞 Something isn't working label Jun 26, 2024
@benoitf
Copy link
Collaborator

benoitf commented Jun 26, 2024

note that it works for simple extensions but not in case of development mode for extensions using multiple workspaces

for example ai-lab has node_modules in the root folder while the extension is in packages/backend folder.

so at some point we try to load /my/folder/node_modules/request/index.js and try to see if it's matching an extension but as the packages/backend is in a subfolder it doesn't work then it throw an error

@dgolovin
Copy link
Contributor

@axel7083 Do you run extension using yarn watch --extension-folder /path/to/extension command?

@dgolovin
Copy link
Contributor

@benoitf Extension is needed only when override is a function. What function does is returning 'ext.api' attribute. In this case ext acts like a cache. If there is no extension it should just cache module for parent.path.

@dgolovin
Copy link
Contributor

@axel7083 What is git repo for the extension that has this problem?

@benoitf
Copy link
Collaborator

benoitf commented Jun 28, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug 🐞 Something isn't working
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

4 participants