Closed SOVLOOKUP closed 3 years ago
have you tried to use a project directory with only ascii characters in it ? i suspect this part 桌面/新建文件夹 (2)
is not handled correctly either by sveltekit or vite. its either the chinese characters, the space, () or a combination of it, so maybe try removing them one by one to find the culprit
on second thought, the part .svelte-kit/output/...
doesn't look right. I was able to replicate the error with an ascii only path
ENOENT: no such file or directory, open '/home/dominikg/develop/reproductions/midway-svelte/.svelte-kit/output/client/_app/manifest.json'
Error: ENOENT: no such file or directory, open '/home/dominikg/develop/reproductions/midway-svelte/.svelte-kit/output/client/_app/manifest.json'
at Object.openSync (fs.js:498:3)
at Object.readFileSync (fs.js:394:35)
at build_client (file:///home/dominikg/develop/reproductions/midway-svelte/node_modules/@sveltejs/kit/dist/chunks/index5.js:354:49)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async build (file:///home/dominikg/develop/reproductions/midway-svelte/node_modules/@sveltejs/kit/dist/chunks/index5.js:231:26)
at async file:///home/dominikg/develop/reproductions/midway-svelte/node_modules/@sveltejs/kit/dist/cli.js:648:23
npm ERR! code ELIFECYCLE
does midway mess with the build/output config of vite in any way? (not familiar with it at all)
We need @Lxxyx to give some help🤔
@dominikg @SOVLOOKUP
Midway will modify Vite's output directory to build
and enable manifest.
You can modify this config at midway.config.ts.
midway.config.ts
import { defineConfig } from '@midwayjs/hooks';
export default defineConfig({
build: {
viteOutDir: '
https://github.com/midwayjs/hooks/blob/2d9a9e49678d818327f5ba07dbb393d17392ac24/packages/vite-plugin-hooks/src/plugin.ts#L75-L78
@dominikg @SOVLOOKUP
Midway will modify Vite's output directory to
build
and enable manifest.You can modify this config at midway.config.ts.
midway.config.ts
import { defineConfig } from '@midwayjs/hooks';
export default defineConfig({ build: { viteOutDir: '
' } }) https://github.com/midwayjs/hooks/blob/2d9a9e49678d818327f5ba07dbb393d17392ac24/packages/vite-plugin-hooks/src/plugin.ts#L75-L78
so i should redirect output to .svelte-kit/output/ ?
so i should redirect output to .svelte-kit/output/ ?
You can try to see if this works
@Lxxyx
You can try to see if this works
It doesn't work, and more strange problems have come up...
To Reproduce: https://github.com/SOVLOOKUP/midway-svelte
Is it possible that the midway/vite-plugin-hooks can work with kit without any extra config?
@Lxxyx Is it possible that the midway/vite-plugin-hooks can work with kit without any extra config?
The following method will build properly.
import { defineConfig } from '@midwayjs/hooks';
export default defineConfig({
superjson: true,
routes: [
{
baseDir: 'lambda',
basePath: '/api',
},
],
build: {
viteOutDir: null
}
} as any);
Thanks for the feedback, I'm considering removing the option to specify viteOutDir in the build to make sure there are no conflicts with other Vite based frameworks
Describe the bug The build does not run properly, error: no such file or directory
Logs
To Reproduce
https://github.com/SOVLOOKUP/midway-svelte
Severity
The bug prevents me from deploying the app... Hope it can be resolved soon.