Comments (4)
I unfortunatly also just realized that I cant use
this.ws = new WebSocket(this.url, this.protocols);
at all....
neither window.WebSocket(this.url, this.protocols);
from plenti.
@s00500 - I assume you're getting a build error like ReferenceError: ReconnectingWebSocket is not defined
, is that correct?
The build process creates both the interactive clientside JS (which has access to browser objects like window
) and HTML fallbacks (which don't have access to the browser / runtime JS). If I have something that needs to be run clientside only, I typically wrap it in onMount so it's ignored by the SSR part of the build that creates the HTML.
Can you try putting the clientside logic inside onMount and let me know if that help? For example:
<script>
import { ReconnectingWebSocket } from "../scripts/reconnecting-ws.js";
import { onMount } from 'svelte';
let ws;
onMount(() => {
ws = new ReconnectingWebSocket("ws://localhost:3", []);
});
</script>
from plenti.
Hey @jimafisk, that nailed it! Thanks a lot !!!
(would ofc be awesome to have a error that can be traced easier ;-) )
from plenti.
Awesome, I'm glad it worked @s00500, thanks for following up!
from plenti.
Related Issues (20)
- Can SSR be enabled with V8 engine? HOT 2
- Error when using CMS editor with GitLab Pages in a monorepo HOT 5
- plenti serve is spitting errors HOT 9
- Fingerprint SPA to bust cache HOT 1
- Can't use "plenti" command HOT 2
- Broken build: invalid go version '1.21.0': must match format 1.23 HOT 1
- Component cache
- Custom env variable
- Live Reload: Broken/Missing JS script? HOT 2
- Git Gateway with Netlify HOT 3
- Use query params to bust cache HOT 1
- tls: failed to verify certificate: x509 HOT 3
- Broken Build: Project file 'snapcraft.yaml' not found HOT 3
- Strip inline style when pasting into inputs HOT 1
- Flatpak support
- Fingerprint every file in SPA HOT 4
- SIGSEGV: segmentation violation on running plenti serve on Linux (0.6.45) HOT 1
- Required fields HOT 1
- Route override fallbacks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plenti.