Skip to content

Commit 976c161

Browse files
committed
Fixed e2e tests not being able to connect to preview when run from Docker
1 parent be39ebc commit 976c161

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"postpublish": "rm -rf packages/core/README.md && rm -rf packages/react/README.md",
3030
"prebuild": "cp README.md packages/core/README.md && cp README.md packages/react/README.md",
3131
"prestart": "vp run build",
32-
"start": "vp preview playground --port 3000",
32+
"start": "vp run --filter @blocknote/example-editor preview",
3333
"test": "vp run -r test",
3434
"format": "vp fmt",
3535
"prepare": "vp config"

playground/vite.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ export default defineConfig(((conf: { command: string }) => ({
6565
build: {
6666
sourcemap: true,
6767
},
68+
preview: {
69+
port: 3000,
70+
// Bind on all interfaces so the dockerized `test:updateSnaps` flow
71+
// can reach the host preview server via `host.docker.internal`.
72+
host: true,
73+
// Vite 5.1+ blocks unknown Host headers as a DNS-rebinding mitigation;
74+
// whitelist the Docker gateway hostname used by the e2e tests.
75+
allowedHosts: ["host.docker.internal"],
76+
},
6877
resolve: {
6978
alias: conf.command === "build" ? undefined : devAliases,
7079
},

0 commit comments

Comments
 (0)