Vue3 compiles with an error when using compositionAPI:
[vite] Internal server error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
The reason I encountered the error reported was because
async setup(props) { // Async asynchronous keyword in front of setup needs to be aware of the risk of blocking await XXXX; // After await, asynchronous blocking causes an error to be reported }
It’s best to write directly with vue3 script setup syntax Vue3 script setup syntax
Similar Posts:
- A parser-blocking, cross site (i.e. different eTLD+1) script, is invoked via document.write
- [Solved] Vue3 vetur error: has no default export component is not exported
- [Err] ORA-24344: success with compilation error
- Spring @Async interrupt/Unable to acquire JDBC Connection
- Inline variable declaration not compiling [How to Solve]
- Didn’t find class “xxxxx” on Path: dexpathlist caused by code obfuscation
- How to Solve Mac Sed Error: command c expects followed by text
- Treatment of MySQL database keyword as column name by mybatisplus — sqlsyntax errorexception: you have an error in your SQL syntax;
- React Error: Import in body of module; reorder to top import/first
- [Solved] Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-*