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

fix(validation): fix lodash imports #519

Merged
merged 2 commits into from
Sep 19, 2023
Merged

fix(validation): fix lodash imports #519

merged 2 commits into from
Sep 19, 2023

Conversation

f1ames
Copy link
Contributor

@f1ames f1ames commented Sep 19, 2023

This PR fixes lodash imports. VSC extension CommonJS compatible imports (or something like this, see message below) and so it was breaking:

[1] CommonJS modules can always be imported via the default export, for example using:
[1]
[1] import pkg from 'lodash';
[1] const { get, unset } = pkg;
[1] .
[1]   monokle-vsc/node_modules/@monokle/validation/lib/validators/custom/simpleValidator.js:8
[1]   import { get, unset } from 'lodash';
[1]            ^^^
[1]   SyntaxError: Named export 'get' not found. The requested module 'lodash' is a CommonJS module, which may not support all module.exports as named exports.
[1]   CommonJS modules can always be imported via the default export, for example using:
[1]
[1]   import pkg from 'lodash';
[1]   const { get, unset } = pkg;
[1]
[1]     at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
[1]     at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

Changes

  • None.

Fixes

  • As above.

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

@changeset-bot
Copy link

changeset-bot bot commented Sep 19, 2023

🦋 Changeset detected

Latest commit: 410cc01

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@monokle/validation Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@f1ames f1ames merged commit be8e479 into main Sep 19, 2023
2 checks passed
@f1ames f1ames deleted the f1ames/fix/lodash-imports branch September 19, 2023 11:52
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

Successfully merging this pull request may close these issues.

2 participants