Skip to content

Commit fede003

Browse files
committed
duckguessr: Fix local setup
1 parent 409d918 commit fede003

File tree

4 files changed

+36
-15
lines changed

4 files changed

+36
-15
lines changed

apps/duckguessr/app/app.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,17 @@ const playerSocket = duckguessrSocketClient.addNamespace<
9191
session,
9292
onConnectError,
9393
onConnected: () => {
94-
playerSocket.getPlayer().then((player) => {
95-
playerStore().playerUser = player;
96-
});
94+
if (import.meta.client) {
95+
playerSocket.getPlayer().then((player) => {
96+
// Use nextTick to ensure Pinia is initialized
97+
nextTick(() => {
98+
const store = playerStore();
99+
if (store) {
100+
store.playerUser = player;
101+
}
102+
});
103+
});
104+
}
97105
},
98106
});
99107

apps/duckguessr/nuxt.config.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ export default defineNuxtConfig({
2323

2424
devtools: { enabled: false },
2525
compatibilityDate: "2025-09-09",
26-
27-
// CSS
28-
css: ["bootstrap/dist/css/bootstrap.min.css", "./styles/main.scss"],
26+
css: ["bootstrap/dist/css/bootstrap.min.css"],
2927

3028
// Modules
3129
modules: [
@@ -114,6 +112,21 @@ export default defineNuxtConfig({
114112
resolve: {
115113
dedupe: ["vue", "vue-i18n", "@vueuse/core", "bootstrap-vue-next"],
116114
},
115+
server: {
116+
fs: {
117+
allow: [
118+
"..",
119+
path.resolve(__dirname, "node_modules"),
120+
path.resolve(__dirname, "../.."),
121+
],
122+
},
123+
},
124+
},
125+
126+
// Dev server config - use 0.0.0.0 to listen on both IPv4 and IPv6
127+
devServer: {
128+
host: "0.0.0.0", // Listen on all interfaces (IPv4 and IPv6)
129+
port: 8007,
117130
},
118131

119132
// App configuration

apps/duckguessr/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"version": "1.0.0",
88
"scripts": {
99
"duckguessr": "concurrently -p \"[duckguessr-{name}]\" --kill-others-on-fail -n web,api,dm \"pnpm -F ~duckguessr dev\" \"pnpm -F ~duckguessr-api dev\" \"pnpm -F ~web web\"",
10-
"dev": "nuxt dev --port 8007",
10+
"dev": "nuxt dev --port 8007 --host 0.0.0.0",
1111
"dev-storybook": "concurrently \"pnpm -F ~duckguessr-api dev\" \"storybook dev\"",
1212
"build": "nuxt build && pnpm build-storybook",
1313
"build-storybook": "storybook build",
@@ -22,6 +22,7 @@
2222
"prod:transfer-files-post": "pnpm -F '~ci' prod:transfer-files apps/duckguessr/docker-compose.yml:@apps/duckguessr/docker-compose.yml apps/duckguessr/Caddyfile:@apps/duckguessr/Caddyfile"
2323
},
2424
"dependencies": {
25+
"@bootstrap-vue-next/nuxt": "^0.42.0",
2526
"@nuxtjs/i18n": "^10.2.1",
2627
"@nuxtjs/storybook": "^9.0.1",
2728
"@pinia/nuxt": "^0.11.3",
@@ -46,7 +47,6 @@
4647
"~web": "workspace:*"
4748
},
4849
"devDependencies": {
49-
"@bootstrap-vue-next/nuxt": "^0.40.9",
5050
"@eslint/eslintrc": "^3.3.3",
5151
"@eslint/js": "^9.39.2",
5252
"@iconify-json/bi": "^1.2.7",

apps/duckguessr/pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)