Closed maxidragon closed 7 months ago
Unfortunately, while we put a lot of effort into writing standard interoperable code, Vite has made some choices that are incompatible. For information and workarounds, see:
https://github.com/cubing/cubing.js/issues/296 https://github.com/vitejs/vite/issues/14499#issuecomment-1740267849
Steps to reproduce the issue
npm create vite@latest
npm install cubing
function App() { const [count, setCount] = useState(0) const [scramble, setScramble] = useState("");
useEffect(() => { const generateScramble = async () => { const scr = await randomScrambleForEvent("333"); setScramble(scr.toString());
}; generateScramble(); }, []);
return ( <>
{scramble}
) }
export default App
transforming (58) node_modules/cubing/dist/lib/cubing/chunks/puzzles-dynamiUnexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit: (commonjs--resolver) resolveId "../chunks/chunk-ZJWG2BON.js" "/home/mgala/test/vite-project/node_modules/cubing/dist/lib/cubing/scramble/index.js" (vite:worker-import-meta-url) transform "/home/mgala/test/vite-project/node_modules/cubing/dist/lib/cubing/chunks/chunk-ZJWG2BON.js" (commonjs--resolver) resolveId "./chunk-ZJWG2BON.js" "/home/mgala/test/vite-project/node_modules/cubing/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-J2CC72NW.js" error during build: Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit: (commonjs--resolver) resolveId "../chunks/chunk-ZJWG2BON.js" "/home/mgala/test/vite-project/node_modules/cubing/dist/lib/cubing/scramble/index.js" (vite:worker-import-meta-url) transform "/home/mgala/test/vite-project/node_modules/cubing/dist/lib/cubing/chunks/chunk-ZJWG2BON.js" (commonjs--resolver) resolveId "./chunk-ZJWG2BON.js" "/home/mgala/test/vite-project/node_modules/cubing/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-J2CC72NW.js" at process.handleBeforeExit (file:///home/mgala/test/vite-project/node_modules/rollup/dist/es/shared/node-entry.js:25902:28) at Object.onceWrapper (node:events:630:26) at process.emit (node:events:515:28)