Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web crash get_os().platform() == 'win32' #394

Open
raspberry-jenshen opened this issue Sep 23, 2024 · 2 comments · Fixed by #395
Open

Web crash get_os().platform() == 'win32' #394

raspberry-jenshen opened this issue Sep 23, 2024 · 2 comments · Fixed by #395
Labels

Comments

@raspberry-jenshen
Copy link

Hello!

Thank you for your cool package!

I faced issues when I converted my Kotlin code to the web platform (JS).

My code:

internal class FileSystemImpl(
    private val fileSystem: KotlinFiles = SystemFileSystem,
) : FileSystem {

The crash:
platform undefined

The crash happens when FileSystemImpl is created.

// JS code
var properties_initialized_FileSystemJs_kt_lg8f5i;
  function _init_properties_FileSystemJs_kt__4boaac() {
    if (!properties_initialized_FileSystemJs_kt_lg8f5i) {
      properties_initialized_FileSystemJs_kt_lg8f5i = true;
      SystemFileSystem = new SystemFileSystem$1();
      // crash is here
      isWindows = get_os().platform() == 'win32';
    }
  }
@fzhinkin
Copy link
Collaborator

@raspberry-jenshen SystemFileSystem is not supported for JS/Browser. It's supported only for NodeJS environment.

fzhinkin added a commit that referenced this issue Sep 23, 2024
Explicitly documents thread-safety guarantees, PeelSource behavior and FileSystem support for JS-target.

Closes #392, #393, #394
fzhinkin added a commit that referenced this issue Sep 23, 2024
* Improve documentation

Explicitly document thread-safety guarantees, PeekSource behavior and FileSystem support for JS-target.

Closes #392, #393, #394
@fzhinkin fzhinkin linked a pull request Sep 23, 2024 that will close this issue
@raspberry-jenshen
Copy link
Author

Oh, I see, please improve the documentation then

Couse, you have this target.

Screenshot 2024-09-25 at 13 42 20

@fzhinkin fzhinkin added the doc label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants