Open bLuma opened 3 months ago
I don't know if this is helpful but I think this issue is more related to the interaction between vite, esbuild or one of the plugins used to transform the vue code. We get this exact same error in our project (and don't use slidev at all) and saw that the esbuild step in our building/bundling process received the .vue SFC file when it was expecting TypeScript code. But this error occures only occasionally so it is very hard to debug.
However I hope this helps to point in the right direction.
And I forgot to mention that I have no error when starting dev server or doing export to pdf. Only build operation is failing.
Possibly https://github.com/vitejs/vite-plugin-vue/issues/431. There is a workaround in https://github.com/dcloudio/uni-preset-vue/issues/102#issuecomment-2251907200. What's the @vitejs/plugin-vue
version you're using?
I have 5.1.2 and ends in error.
| | +-- @vitejs/plugin-vue-jsx@4.0.1 deduped
| | +-- @vitejs/plugin-vue@5.1.2 deduped
| | +-- unplugin-vue-markdown@0.26.2 deduped
| | +-- vite-plugin-vue-server-ref@0.4.2 deduped
| +-- @vitejs/plugin-vue-jsx@4.0.1
| +-- @vitejs/plugin-vue@5.1.2
| +-- unplugin-vue-components@0.27.4
| +-- unplugin-vue-markdown@0.26.2
| +-- vite-plugin-vue-server-ref@0.4.2
Tried mentioned version ~5.0.4, which resulted again in error:
| | +-- @vitejs/plugin-vue-jsx@4.0.1 deduped
| | +-- @vitejs/plugin-vue@5.0.5 overridden
| | +-- unplugin-vue-markdown@0.26.2 deduped
| | +-- vite-plugin-vue-server-ref@0.4.2 deduped
| +-- @vitejs/plugin-vue-jsx@4.0.1
| +-- @vitejs/plugin-vue@5.0.5 overridden
| +-- unplugin-vue-components@0.27.4
| +-- unplugin-vue-markdown@0.26.2
| +-- vite-plugin-vue-server-ref@0.4.2
I tested it also on another computer, where i have windows and it works with plugin-vue 5.1.2. In fact I compared output of "npm ls -a" and i got all packages on same versions on both computers. Yet on one it works and on second still no. To be sure i copied entire project with all installed node modules from working computer to my not working, run build and again got error. So exactly same code works on work computer with Win 10 22H2 and not works on my home computer with Win 11.
And because this looks like some error connected to vite/esbuild feel free to close this issue as this is probably unsolvable by slidev.
Describe the bug
"npm run build" ends in error "[vite:esbuild] Transform failed with 1 error - ERROR: Expected ">" but found "setup"" with just initialized slidev project. Its probably same error as previously encountered in #1808.
Minimal reproduction
Steps to reproduce the behavior:
Environment
Maybe its platform (Windows) related, I tested your "sandbox" environment and know that there build is fine. I'm familiar to Node and react, but not to vue / vite / esbuild, not sure where to look more specifically for error/help with this issue.