"Invalid component name" error when creating a Lightning Web Component from IE in Webstorm
When creating a LWC, any component name I enter seems to be invalid and it’s impossible to create a component! I tried with and without a class name, I even tried to leave everything to default, and I still face the same issue.
Comments (3)
-
repo owner -
repo owner - changed status to resolved
Resolving this since it appears to be working as designed. If it turns out these validation rules are incorrect and are rejecting what should be valid input, please feel free to reopen with full details and I'll consult with Salesforce as to these exceptions to their documentation.
-
reporter Thanks Scott, my bad. Just starting to play around with these LWC and didn’t realize the naming convention was enforced. It would be nice for the error message in IC to provide the details rather than a generic error “Invalid Component name”. A nice to have obviously, not critical at all.
- Log in to comment
LWC component names must begin with a leading lower-cased character. You can find more here:
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/create_components_folder
but the key aspects are:
The IDE enforces those naming conventions in the new component dialog. Please let me know if you've found Salesforce's documentation to be incorrect/stale and such a component name is in fact valid.