fairygui/FairyGUI-threejs

Vite fail

Opened this issue · 0 comments

Hi, I use Vite as my build tool, which is what three.js doc recommended. When running "npx vite" with fairygui, I get an error

caught TypeError: Cannot read properties of undefined (reading 'Vector3')
    at Stage.js:105:19
    at fairygui.js:4:31
    at fairygui.js:5:2
(anonymous) @ Stage.js:105
(ano

I tried vite with your other example https://github.com/fairygui/FairyGUI-threejs-example, it has more errors

Unable to parse HTML; parse5 error code invalid-first-character-of-tag-name
 at F:/Dev/Cas/External/FairyGUI-threejs-example/index.html:8:7
6  |      <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
7  |      <meta name="keywords" content="" />
8  |       <% for (var css in htmlWebpackPlugin.files.css) { %>
   |               ^
9  |      <link href="<%=htmlWebpackPlugin.files.css[css] %>" rel="stylesheet">
10 |      <% } %>

It seems that vite does not support non strict mode

https://vitejs.dev/guide/troubleshooting.html#syntax-error-type-error-happens

How can I get it to run with vite?