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

The power for devs to supress or alter vite errors based on plugin usage #168

Closed
4 tasks done
louiss0 opened this issue May 7, 2023 · 1 comment
Closed
4 tasks done
Labels
enhancement: pending triage wontfix This will not be worked on

Comments

@louiss0
Copy link

louiss0 commented May 7, 2023

Description

Right now Vue throws an error based on whether a script or template is inserted into the template. While this is good for basic vue apps this is not good when Vite PluginVue Nested SFC is used. If you don't know. Vue Nested SFC allows you to create other SFCs inside of an SFC it even automatically exports all of them.

I ran into an issue where vite threw an error for not including a script tag or a template inside of an SFC. I went to the plugin author about this but he said he could not do anything. Now I have to put an empty template or script tag in order to stop the error and it does not even allow me to use script setup at all.

Suggested solution

I suggest allowing the user of a Vite plugin a way to intercept Vite errors when writing a plugin. This will allow the user to write plugins that don't interfere with the DX of using a tool. I think there is a way for a plugin to know about the existence of another plugin but there should be a way to intercept errors as well.

Alternative

No response

Additional context

No response

Validations

@sapphi-red sapphi-red transferred this issue from vitejs/vite May 8, 2023
@sapphi-red
Copy link
Member

The error is thrown from vue compiler that is added by vuejs/core#6781. The rational of this addition is explained at vuejs/core#6676.

I guess vite-plugin-vue-nested-sfc can inject <template></template> when there aren't any <template> or <script>.

Closing as this is not something Vite / plugin-vue does. If you think it needs an option to suppress this error, please create an issue on vuejs/core.

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2023
@sapphi-red sapphi-red added the wontfix This will not be worked on label May 8, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: pending triage wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants