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

Use static import for @monokle/validation #8

Open
f1ames opened this issue Jul 10, 2023 · 2 comments
Open

Use static import for @monokle/validation #8

f1ames opened this issue Jul 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@f1ames
Copy link
Contributor

f1ames commented Jul 10, 2023

The @monokle/validation library is now imported dynamically due to some errors with building and static import which I wasn't able to solve in reasonable amount of time:

async function getDefaultValidator() {
const {createDefaultMonokleValidator} = await import('@monokle/validation');
return createDefaultMonokleValidator();
}

But this makes it a bit harder to work with and e.g. cumbersome to import types.


One of the errors was:

Error [ERR_REQUIRE_ESM]: require() of ES Module monokle-vsc/node_modules/@monokle/validation/lib/node.js from monokle-vsc/out/extension.js not supported.
Instead change the require of node.js in monokle-vsc/out/extension.js to a dynamic import() which is available in all CommonJS modules.
@f1ames f1ames added the enhancement New feature or request label Jul 10, 2023
@f1ames
Copy link
Contributor Author

f1ames commented Jul 13, 2023

Just a small update since I encountered this issue with other ESM-only modules. There is an open issue regarding this so not sure if this is (easily) doable - microsoft/vscode#130367.

@f1ames
Copy link
Contributor Author

f1ames commented Aug 18, 2023

Did first (unfortunately unsuccessful) attempt with kubeshop/monokle-core#479.

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

No branches or pull requests

1 participant