GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [windows] File.readTextSync / File.writeTextSync are stubs — reads yield "undefined", writes silently no-op · Issue #11630 · NativeScript/NativeScript

[windows] File.readTextSync / File.writeTextSync are stubs — reads yield "undefined", writes silently no-op #11630

New issue
Copy link
New issue
Copy link
Open
Open
[windows] File.readTextSync / File.writeTextSync are stubs — reads yield "undefined", writes silently no-op#11630
Copy link

Description

@aleclarson
aleclarson
opened on Nov 9, 2026
Issue body actions

On NativeScript Windows (packaged WinUI/MSIX x64 app), the synchronous file APIs in @nativescript/core are non-functional while their async counterparts work:

  • File.fromPath(p).readTextSync() returns the string "undefined" rather than file contents (feeding it to JSON.parse throws "undefined" is not valid JSON).
  • File.fromPath(p).writeTextSync(text) returns without throwing but does not modify the file. Subsequent calls in the same process also report success without writing — the file keeps its initial contents regardless of write count.

File.readText() / File.writeText() (async) perform real IO on the same paths.

Evidence: a packaged app calling writeTextSync 18 times per boot (instrumented counter, no thrown errors) produced a file containing only the first write's data; readTextSync of that file threw a JSON parse error on "undefined". This caused a preferences-persistence feature to silently lose every write — a real consumer-facing data-loss path for any app relying on the sync APIs (e.g. settings stores, caches).

Environment: Windows 11 x64 (10.0.26200.9711), packaged MSIX, NativeScript Windows runtime current as of Nov 2026.

Activity

  1. triniwiz commented on Nov 10, 2026

    @triniwiz
    triniwiz
    on Nov 10, 2026
    Member
    More actions

    Is this a report from the alpha runtime ?

  2. aleclarson commented on Nov 10, 2026

    @aleclarson
    aleclarson
    on Nov 10, 2026
    ContributorAuthor
    More actions

    @triniwiz No — the original report was already on the beta runtime: @nativescript/windows 1.0.0-beta.24 (core/vite pinned to the abae298 PR #11272 pkg.pr.new builds), packaged x64 MSIX.

    Revalidated on beta.24 again today in the same packaged context:

    • File.readTextSync() on a file with real contents returns undefined (the value, not a string)
    • File.writeTextSync() returns without throwing but does not reliably write — on a fresh file it produces an empty file, after which async writeText on the same File then throws Windows.Foundation.HResult
    • File.exists() also returns undefined rather than false for a missing path

    Async readText/writeText still perform real IO on the same paths, so the gap is specific to the *Sync projections. Still reproduces.

  3. triniwiz commented on Nov 11, 2026

    @triniwiz
    triniwiz
    on Nov 11, 2026
    Member
    More actions

    You can try updating the pkg version to 4fe2d65 windows supported core or 3456c82 linux supported core with some extra core fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.