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

Vue template compiler warnings are handled as errors #88

Open
susnux opened this issue Jun 22, 2023 · 1 comment
Open

Vue template compiler warnings are handled as errors #88

susnux opened this issue Jun 22, 2023 · 1 comment

Comments

@susnux
Copy link

susnux commented Jun 22, 2023

When building for development all template compiler warnings are treated as errors instead of warning and will break the build.

Examples for such warnings are:

text \"Some comment\" between v-if and v-else(-if) will be ignored.

When having a template like this:

<component v-if="foo" />
<!-- Some comment -->
<component v-else />
@susnux
Copy link
Author

susnux commented Jun 22, 2023

For example it could be fixed by changing

pluginContext.error(

to something like:

(process.env.NODE_ENV === 'production' ? pluginContext.error : pluginContext.warn)(

As I think this warning is converted to an error somewhere more deep inside the compiler-sfc.

susnux added a commit to nextcloud-libraries/nextcloud-vue that referenced this issue Jun 22, 2023
We have comments between `v-if` and `v-else` which is not allowed.
For reference see this: vitejs/vite-plugin-vue2#88

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
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

1 participant