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

Lodash Error: Named export 'isBoolean' not found. #66

Closed
marcoluzi opened this issue Oct 9, 2024 · 2 comments · Fixed by #67
Closed

Lodash Error: Named export 'isBoolean' not found. #66

marcoluzi opened this issue Oct 9, 2024 · 2 comments · Fixed by #67
Labels
Bug Something isn't working

Comments

@marcoluzi
Copy link

Issue Summary

Since v0.9.0 I am encountering the following error when I try to run yarn prettier . --write --ignore-unknown.

[error] Named export 'isBoolean' not found. The requested module 'lodash' is a CommonJS module, which may not support all module.exports as named exports.
[error] CommonJS modules can always be imported via the default export, for example using:
[error] 
[error] import pkg from 'lodash';
[error] const { isBoolean } = pkg;
[error] 

Environment

Yarn Version: v4.5.0
Node Version: v20.16.0
Prettier Version: v3.3.3

.prettierrc.js

module.exports = {
	plugins: ['@zackad/prettier-plugin-twig'],
	twigPrintWidth: 160,
	printWidth: 160,
};

Thank you for keeping this plugin alive. :)

@zackad zackad added the Bug Something isn't working label Oct 9, 2024
@zackad
Copy link
Owner

zackad commented Oct 10, 2024

Hi @marcoluzi could you check if this #67 has fixed your issue? Either by

Link this patch into your project

# clone this repo somewhere
git clone https://github.com/zackad/prettier-plugin-twig --branch fix-import

# navigate to cloned repo
cd prettier-plugin-twig

# link custom version
yarn link

# use linked version on your project
cd PATH_TO_YOUR_PROJECT
yarn link @zackad/prettier-plugin-twig

Important

Don't forget to unlink if new version has been released

Or use git version on your package.json

"devDependencies": {
    "@zackad/prettier-plugin-twig": "github:zackad/prettier-plugin-twig#fix-import",
}

Thanks.

@marcoluzi
Copy link
Author

Hey @zackad
Thank you for the fast reply. Yes, this fixed the issue for me. 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants