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

@hubai/core package is loaded twice when extension uses relative imports #5

Open
mtsdnz opened this issue Nov 6, 2023 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mtsdnz
Copy link
Collaborator

mtsdnz commented Nov 6, 2023

There's a critical issue where the @hubai/core package is being loaded twice when extensions use relative imports in the format of @hubai/core/esm/...
This redundancy in loading can lead to performance inefficiencies and unexpected behaviors in the application.

Temporary Workaround:

Until this issue is resolved, it's recommended for all extensions to strictly use absolute imports. For example, use import { X } from '@hubai/core' instead of relative import paths.

Steps to Reproduce:

Include an extension that utilizes relative imports from the @hubai/core package (e.g., @hubai/core/esm/foo-bar).
Observe that the @hubai/core package is loaded twice in the network tab.

Expected Behavior:

The package should only be loaded once, regardless of the import method used in extensions.

Actual Behavior:

The package is loaded twice when relative imports are used in extensions.

I'm still trying to find a solution to this problem, if you have any suggestions please comment below.

In the meantime, we appreciate your cooperation in using absolute imports to avoid this problem.

@mtsdnz mtsdnz added bug Something isn't working help wanted Extra attention is needed labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant