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

Harmonize errors thrown in @lwc/ssr-compiler #5032

Open
nolanlawson opened this issue Dec 10, 2024 · 3 comments
Open

Harmonize errors thrown in @lwc/ssr-compiler #5032

nolanlawson opened this issue Dec 10, 2024 · 3 comments
Labels
enhancement SSR Up for grabs Issues that are relatively small, self-contained, and ready for implementation USER STORY

Comments

@nolanlawson
Copy link
Collaborator

nolanlawson commented Dec 10, 2024

In principle, ssr-compiler should throw exactly the same error messages as babel-plugin-component, template-compiler, etc. for the same input. These errors are defined in @lwc/errors and are designed to be shared.

For expediency, we have not yet used the correct error messages in ssr-compiler. We should.

These errors should ideally also have some way to bubble up the row/column number that caused the error, so that it can be integrated with the VS Code extension.

Copy link

git2gus bot commented Dec 10, 2024

This issue has been linked to a new work item: W-17408217

@nolanlawson nolanlawson added the Up for grabs Issues that are relatively small, self-contained, and ready for implementation label Dec 10, 2024
@cardoso
Copy link
Contributor

cardoso commented Dec 19, 2024

What do you think about reusing the tests (only the ones with error.json) from babel-plugin-component? There are too many possible errors and different scenarios.

@nolanlawson
Copy link
Collaborator Author

@cardoso This is effectively what I did – I copy-pasted some of the tests. I'm a bit on-the-fence about explicitly sharing the test files, though. There aren't that many scenarios, and in a normal environment (including Salesforce), if you get an error for CSR compilation, then your SSR compilation will fail as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement SSR Up for grabs Issues that are relatively small, self-contained, and ready for implementation USER STORY
Projects
None yet
Development

No branches or pull requests

2 participants