Skip to content

Make ced native module optional to prevent Windows startup crash#12

Merged
peterjthomson merged 6 commits intomasterfrom
copilot/fix-windows-software-error
Jan 26, 2026
Merged

Make ced native module optional to prevent Windows startup crash#12
peterjthomson merged 6 commits intomasterfrom
copilot/fix-windows-software-error

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Windows app crashes on startup when the ced native module fails to load due to architecture mismatch or build issues.

Changes

  • Lazy-load ced module: Convert static import to dynamic import with error handling in encoding.js
  • Async guessEncoding: Make function async to support dynamic import, return Promise<Encoding>
  • Fallback to UTF-8: When ced fails to load or throws, default to UTF-8 encoding
  • Update caller: Add await in markdown.js where guessEncoding is called

Impact

App starts successfully even when ced module is unavailable. Encoding detection still works when the module loads correctly. Users with broken ced builds can now use the app with UTF-8 as default encoding.

// Before: static import, crashes on module load failure
import ced from 'ced'

// After: lazy load with fallback
async function getCed() {
  try {
    const cedModule = await import('ced')
    return cedModule.default
  } catch (error) {
    console.warn('Failed to load ced module, defaulting to UTF-8')
    return null
  }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Windows Software Error</issue_title>
<issue_description>Hi sir
Windows software not opening
the following error showing
i attached the error image too
iam using windows 10 x64
pls fix sir
thanks sir

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 26, 2026 04:31
Co-authored-by: peterjthomson <9357736+peterjthomson@users.noreply.github.com>
Co-authored-by: peterjthomson <9357736+peterjthomson@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix software not opening on Windows 10 Make ced native module optional to prevent Windows startup crash Jan 26, 2026
Copilot AI requested a review from peterjthomson January 26, 2026 04:35
@peterjthomson peterjthomson marked this pull request as ready for review January 26, 2026 04:47
@peterjthomson
Copy link
Owner

@cursor review

@claude
Copy link

claude bot commented Jan 26, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Remove trailing spaces on blank lines to pass ESLint.
Includes Windows startup crash fix (ced module made optional)
@peterjthomson peterjthomson merged commit 3847104 into master Jan 26, 2026
9 of 10 checks passed
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

Successfully merging this pull request may close these issues.

Windows Software Error

2 participants