Open CreaDisc opened 1 week ago
Ok, so somehow it works now, but still trying to figure out why. If I import SEA into my bundle at the entry point, everything seems fine. But as soon as I try to import SEA from a Lit component, it breaks.
So this is my Lit component:
@customElement('task-component')
export class TaskComponent extends LitElement {
private todoRepo: TodoRepo | null;
constructor() {
super();
this.todoRepo = getTodoRepo();
}
// ...
}
And this is my Todo Repo module:
import * as Gun from 'gun';
// import 'gun/sea'; // !!! INCLUDING THIS LINE BREAKS SEA GLOBALLY
import 'gun/axe';
export function getTodoRepo(): TodoRepo | null {
if (!window.gun) {
console.log('gun is undefined');
return null;
} else {
console.log("gun is defined in TODO Repo");
return TodoRepo.getInstance();
}
}
// ...
Does somebody have a clue why this is happening?
Hi folks,
currently I am trying to use gun for a Lit-based project. Whenever I try to call
gun.user()
it gives me the error:TypeError: gun.user is not a function
Here is the relevant parts of the project:
this is my bundle entry point:
gun auth module:
This is how I included the scripts in my HTML:
What I tried so far:
window.SEA
is defined every 100ms --> no successI have seen this issue come up before but none of the solutions worked for me, so here I am.