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

Docs wrong for (all?) APIs - A challenge for newbies!! #359

Open
ramezrafla opened this issue Oct 17, 2024 · 3 comments
Open

Docs wrong for (all?) APIs - A challenge for newbies!! #359

ramezrafla opened this issue Oct 17, 2024 · 3 comments

Comments

@ramezrafla
Copy link

After a lot of struggling, we got our NeutralinoJS + Vite app running. I honestly don't think most newbies will survive the out of date / erroneous docs.

This does not work -- no error, just hangs

const result = await window.Neutralino.filesystem.writeFile(
    '/home/ubuntu/test.txt',
    'my file content'
)

This works:

import { filesystem } from "@neutralinojs/lib"
const result = await filesystem.writeFile(
    '/home/ubuntu/test.txt',
    'my file content'
)
@benjammin4dayz
Copy link

Fair point on the docs— it's definitely frustrating to deal with potentially misleading info while connecting the missing dots.

For context, when using a package manager to handle Neutralino's client library, window.Neutralino is undefined unless the project is explicitly importing the Neutralino module and assigning it as a property to the window object, like this:

import * as Neutralino from '@neutralinojs/lib';
window.Neutralino = Neutralino

This is in contrast to a "vanilla" Neutralinojs project with no frontend library, where the client library is included as a script tag inside the HTML and made available on the global window object.

Perhaps the distinction between the two modes needs to be made clearer?

@dhrm1k
Copy link

dhrm1k commented Dec 22, 2024

i know this. the documentation for this project is something i can't even find a good adjective for. i'm having my fair share of trouble working with the filesystem api, and this is what i found on stack overflow. i still haven't solved the problem i was facing, so i don't know if this was a valid solution, but nevertheless.

@dhrm1k
Copy link

dhrm1k commented Dec 22, 2024

@benjammin4dayz there seems to be trouble with the filesystem api even on the Neutralinojs project with no frontend library.

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

No branches or pull requests

3 participants