Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant paste anything, infinite spinning circle #50

Closed
KagetaneHiruko opened this issue Jun 16, 2022 · 1 comment
Closed

Cant paste anything, infinite spinning circle #50

KagetaneHiruko opened this issue Jun 16, 2022 · 1 comment

Comments

@KagetaneHiruko
Copy link

when im trying to paste anything in i get an infinite loading screen, i cant see anything abnormal in the logs, but i got this error in the webconsole right after pasting:

Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

Encountered with opera gx and edge.

Im hosting paaster within docker from a raspberry pi, here is my docker-compose:
version: '3'
services:
starlette:
container_name: paaster_backend
image: wardpearce/paaster-backend
restart: unless-stopped
ports:
- "8888:80"
environment:
MONGO_IP: "paaster_mongodb"
MONGO_PORT: 27017
MONGO_DB: "paaster"
# Nano ID length https://zelark.github.io/nano-id-cc/
NANO_ID_LEN: 21
# Chunk size when sending a encrypted paste back to the client.
READ_CHUNK: 1024
# This is the max paste size of the encrypted data.
MAX_PASTE_SIZE_MB: 3
REDIS_HOST: "paaster_redis"
REDIS_PORT: 6379
# Proxied Frontend URL.
FRONTEND_PROXIED: "http://localhost:8889"
volumes:
# If you change 'SAVE_PATH' this needs to be changed,
# changing 'SAVE_PATH' is not recommended.
- appdata:/app/pastes
depends_on:
- mongodb
networks:
- backend

vite:
container_name: paaster_frontend
image: wardpearce/paaster-frontend
environment:
VITE_BACKEND: "http://localhost:8888"
VITE_NAME: "paaster"
restart: unless-stopped
ports:
- "8889:80"

redis:
container_name: paaster_redis
image: redis
volumes:
- redis:/data
networks:
- backend

mongodb:
image: mongo:4.4.14
container_name: paaster_mongodb
restart: unless-stopped
environment:
MONGODB_DATA_DIR: /data/db
MONDODB_LOG_DIR: /dev/null
volumes:
- mongodbdata:/data/db
networks:
- backend

networks:
backend:
driver: bridge

volumes:
redis:
driver: local
mongodbdata:
driver: local
appdata:
driver: local

@WardPearce
Copy link
Owner

WardPearce commented Jun 18, 2022

Hey, this is most likely a CORs issue. both VITE_BACKEND & FRONTEND_PROXIED need to be the exposed address / domain of your hosted instance of paaster (domain assuming you have reversed proxied them).

For paaster.io for example, VITE_BACKEND: "https://api.paaster.io" & FRONTEND_PROXIED: "https://paaster.io"

Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 this error is due to the web client not actually receiving JSON, whats mostly likely because the VITE_BACKEND isn't pointing at the right location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants