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

Vite example shows this error Could not POST streaming to /sync/stream in WebRemote.ts and 404 Not Found http://localhost:3020/sync/stream #93

Closed
guillempuche opened this issue Mar 9, 2024 · 3 comments

Comments

@guillempuche
Copy link
Contributor

guillempuche commented Mar 9, 2024

When running example-vite pnpm dev with vite.config.ts:

server: {
   port: 3020,
},

The web seems working. But my browser shows this error:

imatge
Could not POST streaming to /sync/stream - 404 - Not Found: [WebRemote.ts:58:14](http://localhost:3020/@fs/Users/guillem/programacio/codi/cites/databases/powersync-js/packages/powersync-sdk-web/src/db/sync/WebRemote.ts)

And also XHR POST http://localhost:3020/sync/stream [HTTP/1.1 404 Not Found 1ms]

Do you know why?

@guillempuche
Copy link
Contributor Author

I write the question here to be searchable in Google for others.

@guillempuche guillempuche changed the title Vite example shows this error Could not POST streaming to /sync/stream Vite example shows this error Could not POST streaming to /sync/stream in WebRemote.ts Mar 9, 2024
@guillempuche guillempuche changed the title Vite example shows this error Could not POST streaming to /sync/stream in WebRemote.ts Vite example shows this error Could not POST streaming to /sync/stream in WebRemote.ts Mar 9, 2024
@guillempuche guillempuche changed the title Vite example shows this error Could not POST streaming to /sync/stream in WebRemote.ts Vite example shows this error Could not POST streaming to /sync/stream in WebRemote.ts and 404 Not Found http://localhost:3020/sync/stream Mar 9, 2024
@stevensJourney
Copy link
Collaborator

Hi @guillempuche this is currently expected behaviour.

The log above the error mentions that there aren't any actual backend credentials configured. This will cause any network requests to the PowerSync instance to fail.

The connecting step is only included in the Vite example to verify that all web worker config has been bundled correctly.

@guillempuche
Copy link
Contributor Author

guillempuche commented Mar 11, 2024

Great @stevensJourney, I imagined this. To stop the confusion, I'd add your hint to README and linking it to this issue.

I'm working on integrating auth with Stytch https://stytch.com/ (support React and React Native). Let's see if I finish it and open source the example. Your examples are little hard to follow because Supabase does everything.


UPDATE:
Project with auth finished https://github.com/guillempuche/localfirst_react_server

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