ITADN

Minimal server template build fails due to backslashes in import paths on Windows

#7Closedzaunt 创建于 2024-08-21
Z
zauntcommented
I'm using Windows. I've created a new Gracile project (using `pnpm create gracile@latest` and choosing the Hono option). I'm getting the following error when I run `pnpm build`. ``` pnpm build > @gracile/template--minimal-server-hono@0.0.2 build > vite build vite v5.4.2 building for production... ✓ 33 modules transformed. dist/client/assets/index-B-aIcIlN.css 0.05 kB │ gzip: 0.05 kB dist/client/assets/document-B0Vc8RBx.css 0.18 kB │ gzip: 0.14 kB dist/client/assets/index-hhDAdDi9.js 10.19 kB │ gzip: 3.68 kB dist/client/assets/document.client-BozJLpjF.js 14.45 kB │ gzip: 5.80 kB ✓ built in 476ms vite v5.4.2 building SSR bundle for production... ✓ 2 modules transformed. x Build failed in 16ms error during build: gracile:routes (52:35): Legacy octal escape is not permitted in strict mode (Note that you need plugins to import files that are not JavaScript) file: gracile:routes:52:35 50: [ 51: ['/', () => import('/src\routes\(home).ts')], 52: ['/404/', () => import('/src\routes\404.ts')], ^ 53: ['/about/', () => import('/src\routes\about.ts')], 54: ['/api/:path*/', () => import('/src\routes\api\[...path].ts')], RollupError: Legacy octal escape is not permitted in strict mode ``` The problem is that the paths in the import statements contain backslashes (actually they contain a mixture of forward and backslashes). The string `\404` is being interpreted as a legacy octal syntax. The paths need to have the backslashes turned into forward slashes (or be escaped).
关闭于 2024-08-25 2 条评论