Skip to content

Commit 4d49f16

Browse files
committed
Fix: Resolve build errors and deployment issues
1 parent 757775c commit 4d49f16

3 files changed

Lines changed: 21 additions & 25 deletions

File tree

.github/workflows/nuxtjs.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
# Build job
2929
build:
3030
runs-on: ubuntu-latest
31+
defaults:
32+
run:
33+
working-directory: ./
3134
steps:
3235
- name: Checkout
3336
uses: actions/checkout@v4
@@ -53,12 +56,6 @@ jobs:
5356
cache: ${{ steps.detect-package-manager.outputs.manager }}
5457
- name: Setup Pages
5558
uses: actions/configure-pages@v5
56-
with:
57-
# Automatically inject router.base in your Nuxt configuration file and set
58-
# target to static (https://nuxtjs.org/docs/configuration-glossary/configuration-target/).
59-
#
60-
# You may remove this line if you want to manage the configuration yourself.
61-
static_site_generator: nuxt
6259
- name: Restore cache
6360
uses: actions/cache@v4
6461
with:

app/plugins/seo.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
export default defineNuxtPlugin(() => {
22
const cfg = useRuntimeConfig().public;
33

4-
// Works on server & client
5-
const reqUrl = useRequestURL();
6-
const absoluteUrl = new URL(reqUrl.pathname + reqUrl.search + reqUrl.hash, cfg.siteUrl).toString();
4+
// Only run on client side for SPA mode
5+
if (process.client) {
6+
const reqUrl = useRequestURL();
7+
const absoluteUrl = new URL(reqUrl.pathname + reqUrl.search + reqUrl.hash, cfg.siteUrl).toString();
78

8-
// Ensure og:image is absolute too
9-
const absoluteOg = cfg.socialPreview?.startsWith("http")
10-
? cfg.socialPreview
11-
: new URL(cfg.socialPreview || "/images/devcongress-social-card.jpg", cfg.siteUrl).toString();
9+
// Ensure og:image is absolute too
10+
const absoluteOg = cfg.socialPreview?.startsWith("http")
11+
? cfg.socialPreview
12+
: new URL(cfg.socialPreview || "/images/devcongress-social-card.jpg", cfg.siteUrl).toString();
1213

13-
useHead({
14-
link: [{ rel: "canonical", href: absoluteUrl }],
15-
meta: [
16-
{ property: "og:url", content: absoluteUrl },
17-
{ name: "twitter:image", content: absoluteOg },
18-
],
19-
});
14+
useHead({
15+
link: [{ rel: "canonical", href: absoluteUrl }],
16+
meta: [
17+
{ property: "og:url", content: absoluteUrl },
18+
{ name: "twitter:image", content: absoluteOg },
19+
],
20+
});
21+
}
2022
});

nuxt.config.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const organizationJsonLd = {
3535
export default defineNuxtConfig({
3636
compatibilityDate: "2025-07-15",
3737
devtools: { enabled: true },
38+
ssr: false,
3839

3940
modules: ["@nuxt/image", "@nuxt/ui", "nuxt-lucide-icons"],
4041
css: ["~/assets/css/main.css"],
@@ -101,11 +102,7 @@ export default defineNuxtConfig({
101102
},
102103
},
103104
nitro: {
104-
preset: "github-pages",
105-
prerender: {
106-
crawlLinks: true,
107-
failOnError: false,
108-
},
105+
preset: "static",
109106
},
110107

111108
vite: {

0 commit comments

Comments
 (0)