Closed Sammy-Nyakabau closed 1 year ago
We can't properly diagnose anything without a reproduction. It doesn't matter whether you can share the project you are having this issue with, because you should be providing a minimal, stripped-down reproduction anyway.
From the error message, it looks like there is some bad interaction between rollup-plugin-dynamic-import-variables
and the contents of your src/components/ProfileInformation.svelte
file.
Closing due to lack of proper reproduction.
Hi, I have similar issue with Svelte Kit and Vercel. I migrated my app from Sapper to Svelte Kit, but now I am not able to publish it on Vercel, because the public directory is not created.
I tried to set public dir to .svelte-kit
, in this case build ends successfully, but there is "Not found" error.
Then I tried to set .svelte-kit/build
to public dir, deployed successfully, but there was raw JS code shown on production URL.
I also tried to set Vercel adapter rather than Auto, the result was the same. Lastly I cloned the default SvelteKit project with Vercel template to https://sveltekit-git-main-ondrej2.vercel.app/ and compare it's Vercel settings and svelte config, both are the same as in my project.
Both Dev and Preview mode works fine on localhost.
Attaching build report.
What do I do wrong? Thanks for any advice or clue!
05:19:15.806 | Cloning completed: 1.620s
05:19:16.760 | Looking up build cache...
05:19:18.158 | Build cache downloaded [19.82 MB]: 1062.339ms
05:19:18.406 | Running "vercel build"
05:19:18.881 | Vercel CLI 25.2.2 build (beta) — https://vercel.com/feedback
05:19:18.964 | > Loaded env from ".env"
05:19:19.101 | Installing dependencies...
05:19:20.280 |
05:19:20.280 | up to date in 985ms
05:19:20.281 |
05:19:20.281 | 65 packages are looking for funding
05:19:20.281 | run npm fund
for details
05:19:20.521 | Detected package-lock.json
generated by npm 7...
05:19:20.521 | Running "npm run build"
05:19:20.816 |
05:19:20.816 | > sveltheme-frontend@0.0.1 build
05:19:20.816 | > svelte-kit build
05:19:20.816 |
05:19:21.519 | vite v2.9.13 building for production...
05:19:21.620 | transforming...
05:19:26.681 | ✓ 121 modules transformed.
05:19:26.853 | rendering chunks...
05:19:26.955 | Client build completed. Wrote 32 chunks and 13 assets
05:19:26.956 | Building server
05:19:26.967 | .svelte-kit/output/client/_app/immutable/manifest.json 9.28 KiB
05:19:26.974 | .svelte-kit/output/client/_app/immutable/pages/error.svelte-e37688ae.js 1.51 KiB / gzip: 0.85 KiB
05:19:26.974 | .svelte-kit/output/client/_app/immutable/pages/byty/index.svelte-528d80c7.js 12.15 KiB / gzip: 4.53 KiB
05:19:26.974 | .svelte-kit/output/client/_app/immutable/start-720e9f66.js 26.00 KiB / gzip: 8.98 KiB
05:19:26.974 | .svelte-kit/output/client/_app/immutable/pages/byty/slug.svelte-a944859e.js 15.50 KiB / gzip: 4.75 KiB
05:19:26.975 | .svelte-kit/output/client/_app/immutable/pages/slug.svelte-b00128e7.js 2.41 KiB / gzip: 1.18 KiB
05:19:26.975 | .svelte-kit/output/client/_app/immutable/pages/patra/index.svelte-b6ef8fdf.js 0.22 KiB / gzip: 0.19 KiB
05:19:26.975 | .svelte-kit/output/client/_app/immutable/pages/hledat/search.svelte-9d5ea335.js 9.12 KiB / gzip: 3.41 KiB
05:19:26.975 | .svelte-kit/output/client/_app/immutable/pages/tirata_admin.svelte-86c49d89.js 0.25 KiB / gzip: 0.21 KiB
05:19:26.975 | .svelte-kit/output/client/_app/immutable/pages/patra/slug.svelte-a9abbd88.js 2.91 KiB / gzip: 1.34 KiB
05:19:26.975 | .svelte-kit/output/client/_app/immutable/chunks/preload-helper-37d74a8a.js 1.34 KiB / gzip: 0.81 KiB
05:19:26.976 | .svelte-kit/output/client/_app/immutable/chunks/singletons-d1fb5791.js 0.05 KiB / gzip: 0.07 KiB
05:19:26.976 | .svelte-kit/output/client/_app/immutable/chunks/Link-c28b6159.js 1.36 KiB / gzip: 0.80 KiB
05:19:26.976 | .svelte-kit/output/client/_app/immutable/pages/layout.svelte-3a1e64c8.js 25.22 KiB / gzip: 9.33 KiB
05:19:26.976 | .svelte-kit/output/client/_app/immutable/chunks/navigation-fe373893.js 0.19 KiB / gzip: 0.16 KiB
05:19:26.976 | .svelte-kit/output/client/_app/immutable/pages/index.svelte-a7905201.js 24.70 KiB / gzip: 7.36 KiB
05:19:26.976 | .svelte-kit/output/client/_app/immutable/chunks/html-3a706857.js 14.49 KiB / gzip: 5.25 KiB
05:19:26.978 | .svelte-kit/output/client/_app/immutable/chunks/Head-bb57bc87.js 4.92 KiB / gzip: 1.91 KiB
05:19:26.978 | .svelte-kit/output/client/_app/immutable/chunks/api-97e42fa3.js 0.34 KiB / gzip: 0.27 KiB
05:19:26.978 | .svelte-kit/output/client/_app/immutable/chunks/Content-4ecae4a6.js 1.51 KiB / gzip: 0.89 KiB
05:19:26.978 | .svelte-kit/output/client/_app/immutable/chunks/index-5fcc941d.js 13.77 KiB / gzip: 5.69 KiB
05:19:26.978 | .svelte-kit/output/client/_app/immutable/chunks/PageHeader-f9df1552.js 1.75 KiB / gzip: 0.93 KiB
05:19:26.979 | .svelte-kit/output/client/_app/immutable/chunks/index-41cb2848.js 0.21 KiB / gzip: 0.18 KiB
05:19:26.981 | .svelte-kit/output/client/_app/immutable/chunks/ContactForm-d071d62f.js 8.54 KiB / gzip: 3.20 KiB
05:19:26.981 | .svelte-kit/output/client/_app/immutable/chunks/Image-10ee6886.js 3.08 KiB / gzip: 1.52 KiB
05:19:26.981 | .svelte-kit/output/client/_app/immutable/chunks/msg-8e250072.js 0.63 KiB / gzip: 0.38 KiB
05:19:26.981 | .svelte-kit/output/client/_app/immutable/chunks/search-52439ac6.js 0.12 KiB / gzip: 0.11 KiB
05:19:26.981 | .svelte-kit/output/client/_app/immutable/chunks/appartment-3cbab68c.js 1.23 KiB / gzip: 0.65 KiB
05:19:26.981 | .svelte-kit/output/client/_app/immutable/chunks/form-7160d3e5.js 0.50 KiB / gzip: 0.34 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/chunks/StoreyTable-dddd304a.js 13.87 KiB / gzip: 4.55 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/Content-a453a534.css 3.97 KiB / gzip: 1.02 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/PageHeader-30a9babd.css 0.79 KiB / gzip: 0.36 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/pages/byty/slug.svelte-3d7d7816.css 0.71 KiB / gzip: 0.25 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/ContactForm-1744c588.css 1.58 KiB / gzip: 0.59 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/pages/byty/index.svelte-9c977832.css 1.40 KiB / gzip: 0.51 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/StoreyTable-43c8d0c5.css 2.32 KiB / gzip: 0.66 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/pages/hledat/search.svelte-cd9417a4.css 0.34 KiB / gzip: 0.21 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/pages/patra/slug.svelte-e7f619b3.css 0.08 KiB / gzip: 0.09 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/StoreyPlan-0cc44fde.css 1.63 KiB / gzip: 0.29 KiB
05:19:26.982 | .svelte-kit/output/client/_app/immutable/assets/pages/index.svelte-98ac8067.css 8.64 KiB / gzip: 2.10 KiB
05:19:26.983 | .svelte-kit/output/client/_app/immutable/chunks/glightbox.min-5144f092.js 40.16 KiB / gzip: 11.79 KiB
05:19:26.983 | .svelte-kit/output/client/_app/immutable/assets/pages/layout.svelte-d8eb1f57.css 54.10 KiB / gzip: 9.51 KiB
05:19:26.983 | .svelte-kit/output/client/_app/immutable/assets/guttenberg-cb1d187c.css 53.80 KiB / gzip: 8.15 KiB
05:19:26.983 | .svelte-kit/output/client/_app/immutable/chunks/splide.esm-99cdbe39.js 39.32 KiB / gzip: 16.12 KiB
05:19:26.996 | .svelte-kit/output/client/_app/immutable/chunks/StoreyPlan-1b145892.js 244.20 KiB / gzip: 37.81 KiB
05:19:27.003 | vite v2.9.13 building SSR bundle for production...
05:19:27.184 | transforming...
05:19:29.062 | ✓ 117 modules transformed.
05:19:29.102 | Generated an empty chunk: "hooks"
05:19:29.115 | rendering chunks...
05:19:29.163 | .svelte-kit/output/server/manifest.json 7.47 KiB
05:19:29.164 | .svelte-kit/output/server/index.js 73.58 KiB
05:19:29.164 | .svelte-kit/output/server/entries/endpoints/sitemap.xml.js 0.90 KiB
05:19:29.164 | .svelte-kit/output/server/entries/pages/layout.svelte.js 127.12 KiB
05:19:29.164 | .svelte-kit/output/server/entries/pages/__error.svelte.js 0.98 KiB
05:19:29.165 | .svelte-kit/output/server/entries/pages/slug.svelte.js 1.69 KiB
05:19:29.165 | .svelte-kit/output/server/entries/pages/byty/slug.svelte.js 8.83 KiB
05:19:29.165 | .svelte-kit/output/server/entries/pages/byty/index.svelte.js 9.13 KiB
05:19:29.165 | .svelte-kit/output/server/entries/pages/hledat/search.svelte.js 6.86 KiB
05:19:29.165 | .svelte-kit/output/server/entries/pages/index.svelte.js 27.13 KiB
05:19:29.165 | .svelte-kit/output/server/entries/pages/patra/slug.svelte.js 2.36 KiB
05:19:29.165 | .svelte-kit/output/server/entries/pages/patra/index.svelte.js 0.30 KiB
05:19:29.165 | .svelte-kit/output/server/entries/pages/tirata_admin.svelte.js 0.35 KiB
05:19:29.165 | .svelte-kit/output/server/chunks/index-b60f7d7e.js 7.23 KiB
05:19:29.165 | .svelte-kit/output/server/chunks/api-97e42fa3.js 0.62 KiB
05:19:29.165 | .svelte-kit/output/server/chunks/html-0300acf0.js 1.34 KiB
05:19:29.165 | .svelte-kit/output/server/chunks/stores-f0be75ae.js 20.85 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/Link-feeb5af9.js 1.13 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/Head-8555753a.js 4.69 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/Content-4ac3e065.js 9.04 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/PageHeader-3d976e70.js 3.02 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/ContactForm-2a06d660.js 7.72 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/Image-85293e22.js 3.91 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/StoreyPlan-ff1a9c8c.js 230.19 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/StoreyTable-0fb1a4f2.js 10.72 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/hooks-1c45ba0b.js 0.00 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/msg-8e250072.js 0.73 KiB
05:19:29.166 | .svelte-kit/output/server/chunks/form-7160d3e5.js 0.60 KiB
05:19:29.167 | .svelte-kit/output/server/chunks/search-52439ac6.js 0.15 KiB
05:19:29.167 | .svelte-kit/output/server/chunks/appartment-3cbab68c.js 1.59 KiB
05:19:29.167 | Prerendering
05:19:29.202 | Building service worker
05:19:29.212 | vite v2.9.13 building for production...
05:19:29.214 | transforming...
05:19:29.218 | ✓ 2 modules transformed.
05:19:29.222 | rendering chunks...
05:19:29.223 | .svelte-kit/output/client/service-worker.js 5.88 KiB / gzip: 1.63 KiB
05:19:29.223 |
05:19:29.223 | Run npm run preview to preview your production build locally.
05:19:29.224 |
05:19:29.224 | No adapter specified
05:19:29.224 | See https://kit.svelte.dev/docs/adapters to learn how to configure your app to run on the platform of your choosing
05:19:29.312 | Error! No Output Directory named "public" found after the Build completed. You can configure the Output Directory in your Project Settings.
05:19:29.312 | Learn More: https://vercel.link/missing-public-directory
05:19:29.421 | Error: Command "vercel build" exited with 1
@frontycore similar case on this end. I had this working fine at one point and something changed. Did you ever find a solution?
I created an issue on my repo i'll link here as well: https://github.com/oneezy/monorepo/issues/1
@Conduitry can we reopen this? seems to be affecting a few people
I started a brand new SvelteKit project and attempted to deploy it to Vercel, and I got the error that the OP describes about a missing public
directory.
It turns out that the problem was because I had configured it to use the Node.js adapter, as specified in the SvelteKit docs. (I had done this so that I could test out a deployment on my local computer.)
So, if this is happening to you, the solution is to convert your project back to the adapter-auto
and remove the out
field from the adapter
argument.
@Zamiell what do you mean when you say "remove the out
field from the adapter
argument"?
Still unable to resolve the issue on my end but I'm using Turborepo + Sveltekit.
what do you mean when you say "remove the out field from the adapter argument"?
Read Svelte docs and look what they say:
For node.js, they recommend making these two changes, which includes adding an "out" field. So, if you want to deploy to Vercel, you have to remember to revert these changes back to the hello-world default.
I'm also seeing this on Vercel from upgrading to the latest version of sveltekit, which is a regression from a successful deployment a few days ago. I feel like this issue should be reopened until the cause is pinned down
FWIW my issue was that I was sharing vite config in a monorepo, and importing { sveltekit } from '@sveltejs/kit/vite'
from the shared config rather than the project caused the adapter to not run. Might be worth documenting that that has to be imported from the project root in a monorepo env.
Otherwise this can probably be closed out again, sorry for the false alarm!
that's likely what my issue is @madeleineostoja thanks for the tip. do you have that code in a repo anywhere? I'm about to give it a try
here's what my monorepo setup looks like
EDIT:
Can confirm @madeleineostoja 's solution working on my end. I just copied my shared packages/config/vite.config.js
into my apps/site/vite.config.js
and it worked like a charm. Kind of irritating but it works
All you need to do is pass the apps sveltekit plug-in to your shared config, no need to copy n paste the whole thing
All you need to do is pass the apps sveltekit plug-in to your shared config, no need to copy n paste the whole thing
I actually tried that but didn't work on first go. like this right?
import { viteConfig } from '@packages/config';
import { sveltekit } from '@sveltejs/kit/vite';
/** @type {import('vite').UserConfig} */
const config = {
...viteConfig,
plugins: [
sveltekit(),
],
};
export default config;
Closing again since it seems the issue is resolved/unrelated. Not sure where and how to document that monorepo caveat best (probably not inside the Vercel adapter, this is likely something more general) - ideas welcome.
Could you have a “working with monorepos” section in the general docs under advanced? It’d be a small section but probably worthwhile
Could also flag the gotcha that it’s currently not possible to extend sveltekit tsconfig if you have a shared tsconfig for the monorepo
"Could you have a “working with monorepos” section in the general docs under advanced? It’d be a small section but probably worthwhile"
@madeleineostoja @dummdidumm I second that !
Would also be cool to see a Svelte #monorepo discord channel but not holding my breath. Looks like svelte discord has been downsizing.
There is a Turborepo #svelte discord channel but it doesn't get much love.
For anyone seeing this, we've made a ton of progress in our Turborepo + Sveltekit + Tailwind + Histoire starter (oneezy/monorepo).
Contributions and Issue fixin' are always welcome 😄
Copying from https://github.com/oneezy/monorepo/issues/1#issuecomment-1441117634 in case anyone else is using Turbo + Vercel + Sveltekit.
----->%-------
thought i'd just leave this here since i was having the same issue and this was the first result: if you're using turborepo, don't forget the .vercel/ directory in the build output!
"pipeline": {
"build": {
"dependsOn": [...]
- "outputs": [..., ".svelte-kit/**"],
+ "outputs": [..., ".svelte-kit/**", ".vercel/**"],
...
},
}
@coryvirok answer solved my issue! Just a heads up, now in Turborepo v2, pipeline has been renamed to "tasks", so the new turbo.json
would be:
"tasks": { "build": { "dependsOn": [...] - "outputs": [..., ".svelte-kit/**"], + "outputs": [..., ".svelte-kit/**", ".vercel/**"], ... }, }
I'm trying to update turborepo from 1.13.3 to 2.0.6 and started seeing this issue. My tasks config has the correct output, and the project in vercel is using default settings.
What seems confusing to me is in vercel the default settings say "public" so why is my project working fine with turbo 1 and the same output from turbo?
Describe the bug
Tried deploying on Vercel but the build part is failing because of output directory. Vercel is expecting
public
to be the output directory.Reproduction
Unfortunately I can't provide a link to the repo since it is a private project
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response