tipex icon indicating copy to clipboard operation
tipex copied to clipboard

Using PWA without SvelteKit gives error

Open lalilaloe opened this issue 10 months ago • 2 comments

image

For now I removed the browser check with a patch. In my case I use a PWA with Routify. Maybe another more universal check if the EditLinkMenu component is SSR or in the browser will do

lalilaloe avatar Apr 24 '24 10:04 lalilaloe

I second this. Using Tipex in a non-sveltekit environment is difficult. I also needed rollup-plugin-node-polyfills in my rollup config to get over the process object.

mzehrer avatar Jul 17 '24 15:07 mzehrer

I will consider about the EditLinkMenu? Can I know more about the issue?

Bishwas-py avatar Sep 08 '24 03:09 Bishwas-py

I will consider about the EditLinkMenu? Can I know more about the issue?

In a svelte project without sveltekit there is no $app environment. So in my patch tipex/link/EditLinkMenu.svelte

I removed the browser check;

-  import { browser } from "$app/environment";
...
-  if (browser && enableLinkEdit) {
+  if (enableLinkEdit) {
     pasteLink();
   }

if you want you could replace it with const is_browser = typeof window !== "undefined"; for example to keep framework agnostic

lalilaloe avatar Oct 20 '24 03:10 lalilaloe