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

getting an error 'cannot read properties of undefined (reading 'endsWith')' #12

Open
mahmoudadel54 opened this issue Sep 11, 2024 · 2 comments

Comments

@mahmoudadel54
Copy link

It was working well and suddenly when I make save file to sort the imports it gave me this error:

image

@Alex-Rudoy
Copy link
Owner

do you have file example how to reproduce it? or maybe you can debug and create PR yourself?

@mahmoudadel54
Copy link
Author

mahmoudadel54 commented Nov 19, 2024

do you have file example how to reproduce it? or maybe you can debug and create PR yourself?
@Alex-Rudoy
I have investigated for this issue, and I found this issue is related to comment lines in this format:

/*
 * Copyright 2024, 
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 */

this is existing to a react component in my project

and in another case, when there is a js doc for my react component in this format

/**
 * bla bla bla component
 * @param {object} props properties of the component
 * @param {string} props.doingSomthing ...etc
 * @param {object} props.clickHandler to do bla bla bla
 * @return {JSX.Element}
 */

When I removed them from the file, the sort works well without raising this error

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

No branches or pull requests

2 participants