grantila / grantila/suretype

Duplicate index.js loading in Electron App

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
505
Forks
8
PR merge metrics
No merged PRs in 30d

Description

It seems that when using suretype in an Electron app, index.js is being loaded twice. As a result, event handlers are registered twice and states are also duplicated. Since the app only updates one of the states during operation, certain processes that rely on the state cannot function properly.

It is not clear where the problem is specifically occurring, but commenting out [this line](https://github.com/grantila/suretype/blob/e03ccb3665fb51081a213efe4faad9e595bb17f8/lib/index-browser.ts#L2) seems to prevent the issue, so the cause may be related to awesome-ajv-errors.

[code that reproduces the issue](https://github.com/noze12/suretype-issue-repro/commit/ce2394eac96e4e915097c30bc118b7d5e3063a54)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.