Sorry for the long post ahead, I’ve been trying to work around this issue for a while now, and I’m sharing the current issue with as much information to hopefully get it fixed.
-
Objective: Lauch the server locally and start experimenting with frontend-2 feature additions. I’m currently stuck at the very first step, which is creating, authenticating, and signing into an account.
-
Build/launch:
I’m currently following these steps to build and launch this repo:
cd speckle-server
corepack enable
yarn
yarn build
yarn dev:docker:up
cp packages/server/.env.example packages/server/.env
cp packages/server/.env.test-example packages/server/.env.test
cp packages/frontend-2/.env.example packages/frontend-2/.env
cp packages/dui3/.env.example packages/dui3/.env
#(NOTE THIS DOESN’T WORK in 2.24.2 the .env.example is not created in dui3)yarn dev
"
- Issue: I suspect the main issue here stems from the authentication process. However there are three main issues I’m having here:
-
Main problem: Upon going through the signup process there is a popup UI that states “Registration failed: Failed to fetch,” and in network console the request fails as CORS Error
- Network TAB:
- The network Request looks like:
fetch("http://127.0.0.1:3000/auth/local/register?challenge=pk3vssdahc", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/json",
"sec-ch-ua": "\"Not A(Brand\";v=\"8\", \"Chromium\";v=\"132\", \"Google Chrome\";v=\"132\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"Referer": "http://localhost:8081/",
"Referrer-Policy": "strict-origin-when-cross-origin"
},
"body": "{\"email\":\"test@test5.com\",\"name\":\"testy\",\"password\":\"Password123\"}",
"method": "POST"
});
- Follow the request above CORS Error request looks like:
fetch("http://127.0.0.1:8081/?access_code=319163c9f255ab82742bee71540c04c4a1862d9bfb®ister=true", {
"headers": {
"Referer": "http://localhost:8081/",
"Referrer-Policy": "strict-origin-when-cross-origin"
},
"body": null,
"method": "GET"
});
Note: this process generates a MailDev authentication email at “http://localhost:1080/” for the signup request.
Looking at the progress user database in the container, it looks like:
*Command: docker exec web-app-postgres-1 psql -U speckle -d speckle -c "SELECT id, email, name, verified FROM users;"
id | email | name | verified
------------+-------------------------+---------+----------
0123456789 | speckle@speckle.systems | speckle | t
05af658709 | test@test2.com | testy | f
496e18e488 | test@test5.com | testy | f
- Authentication problem:
As a sanity check, I manually set the verified field in this database to true for all users:
id | email | name | verified
------------+-------------------------+---------+----------
0123456789 | speckle@speckle.systems | speckle | t
05af658709 | test@test2.com | testy | t
496e18e488 | test@test5.com | testy | t
Now, when attempting to log in I get the following errors in the Networking tab:
Log in Request:
fetch("http://127.0.0.1:3000/auth/local/login?challenge=pk3vssdahc", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/json",
"sec-ch-ua": "\"Not A(Brand\";v=\"8\", \"Chromium\";v=\"132\", \"Google Chrome\";v=\"132\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"Referer": "http://localhost:8081/",
"Referrer-Policy": "strict-origin-when-cross-origin"
},
"body": "{\"email\":\"test@test5.com\",\"password\":\"Password123\"}",
"method": "POST"
});
RESPONSE Header for login requst:
HTTP/1.1 302 Found
x-request-id: da3047aa-326f-4994-9cc8-604b4bd57f03
Access-Control-Allow-Origin: *
X-RateLimit-Remaining: 1
Content-Security-Policy: frame-ancestors 'none'
Location: http://127.0.0.1:8081/?access_code=c6f61d83591c82f838d580165a5cec78218798c143
Vary: Accept
Content-Type: text/plain; charset=utf-8
Content-Length: 99
Date: Tue, 27 May 2025 20:28:27 GMT
Connection: keep-alive
Keep-Alive: timeout=61
Followed by CORS Error:
fetch("http://127.0.0.1:8081/?access_code=88c799cb6e2ef3caed9c1bc7ceb0baf487b105c89c", {
"headers": {
"Referer": "http://localhost:8081/",
"Referrer-Policy": "strict-origin-when-cross-origin"
},
"body": null,
"method": "GET"
});
- Minor Problem: http://localhost:3000/authn/register seems to have a problem where pressing sign up triggers nothing. The button seems like its grayed out blue and status never changes. http://localhost:8081/authn/register, on the other hand, works without generating any issues.
Follow-up Question:
Do you guys use local builds to develop new speckle-server versions? If so is there anything different about the build process I am missing? Also if use an alternetive approch to developing new features do you mind sharing that?
In case it’s relevant Build info:
I’m running Windows 11 with WSL2 on the Ubuntu 22.04 image. Both Docker and Docker Compose are installed in the Ubuntu environment, regardless of whether it is used on Windows. I’ve installed Mise and have installed Node.js v22.14.0 to use here.
Docker containers are running with no errors:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c0ef0279d6a5 redislabs/redisinsight:latest "./docker-entry.sh n…" 3 hours ago Up 3 hours 5540/tcp, 127.0.0.1:8001->8001/tcp web-app-redis_insight-1
8346dfeff890 quay.io/keycloak/keycloak:25.0 "/opt/keycloak/bin/k…" 3 hours ago Up 3 hours 0.0.0.0:8443->8443/tcp, [::]:8443->8443/tcp, 0.0.0.0:8090->8080/tcp, [::]:8090->8080/tcp, 0.0.0.0:9010->9000/tcp, [::]:9010->9000/tcp web-app-keycloak-1
ba1d1b6be295 dpage/pgadmin4 "/entrypoint.sh" 3 hours ago Up 3 hours 443/tcp, 127.0.0.1:16543->80/tcp web-app-pgadmin-1
f71c6835cf0e minio/minio "/usr/bin/docker-ent…" 3 hours ago Up 3 hours 127.0.0.1:9000-9001->9000-9001/tcp web-app-minio-1
80ba0d9d3f39 redis:7-alpine "docker-entrypoint.s…" 3 hours ago Up 3 hours 127.0.0.1:6379->6379/tcp web-app-redis-1
2c3db2431834 web-app-postgres "docker-entrypoint.s…" 3 hours ago Up 3 hours 127.0.0.1:5432->5432/tcp web-app-postgres-1
2b6c9bfb34ec maildev/maildev "bin/maildev" 3 hours ago Up 3 hours (healthy) 127.0.0.1:1025->1025/tcp, 127.0.0.1:1080->1080/tcp web-app-maildev-1
c9c35bc8ba19 web-app-postgres-region2 "docker-entrypoint.s…" 3 hours ago Up 3 hours 127.0.0.1:5402->5432/tcp web-app-postgres-region2-1
b28a7f934802 minio/minio "/usr/bin/docker-ent…" 3 hours ago Up 3 hours 127.0.0.1:9040->9000/tcp, 127.0.0.1:9041->9001/tcp web-app-minio-region2-1
8ea88776d644 minio/minio "/usr/bin/docker-ent…" 3 hours ago Up 3 hours 127.0.0.1:9020->9000/tcp, 127.0.0.1:9021->9001/tcp web-app-minio-region1-1
10415270e9bf web-app-postgres-region1 "docker-entrypoint.s…" 3 hours ago Up 3 hours 127.0.0.1:5401->5432/tcp web-app-postgres-region1-1