-
Notifications
You must be signed in to change notification settings - Fork 138
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
Plugin crashes reading file: Cannot read properties of undefined (reading 'buildError') #287
Labels
Comments
I encounter this issue too. |
Same |
I get this error when I have a variable and an imported type with the same type. Renaming one of them resolves the issue temporarily. Example: import type { User } from './userModal';
// ...
type UserModalType = Omit<User, 'id'>;
// ...
const User: UserModalType = {
// ...
} Temporary Fix: import type { User as UserModal } from './userModal';
// ...
type UserModalType = Omit<UserModal, 'id'>;
// ...
const User: UserModalType = {
// ...
} |
getting the same, error is there a permanent solution for this? |
Getting the same error. |
Similar for me:
Prettier 3.5.1 |
That issue is being discussed here prettier/prettier#17139 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your Environment
Describe the bug
plugin throws an error when parsing a specific file.
That file contains an import for
QuoteSelectPet
, and that same name is used elsewhere in the file asconst QuoteSelectionPet
.To Reproduce
parse this file:
Expected behavior
Prettier (with the help of the plugin) should be able to:
1 - Detect when the imports aren't sorted properly (without --write)
or
2 - sort the imports properly (with --write)
Screenshots, code sample, etc

Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Error log
Contribute to @trivago/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: