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

ports/webassembly: import into node fails #14363

Closed
2 tasks done
hoihu opened this issue Apr 23, 2024 · 4 comments
Closed
2 tasks done

ports/webassembly: import into node fails #14363

hoihu opened this issue Apr 23, 2024 · 4 comments
Labels

Comments

@hoihu
Copy link
Sponsor Contributor

hoihu commented Apr 23, 2024

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

macOS, Node V20.11, Emscripten Port

MicroPython version

MicroPython v1.23.0-preview.324.g6634fea23.dirty on 2024-04-23; JS with Emscripten

Reproduction

fischmar@MACNP7L4XQC6C build-pyscript % node                
Welcome to Node.js v20.11.1.
Type ".help" for more information.
> const mp_mjs = await import("./micropython.mjs");
Uncaught:
TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string. Received undefined
    at validateString (node:internal/validators:162:11)
    at Module.resolve (node:path:1101:7) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Expected behaviour

Import in node does not cause a fault.

Issuing node micropython.mjs correctly gives me the repl, so the mjs file seems to be ok.

Or maybe I'm missing something here? I was following the readme, section here:

const mp_mjs = await import("micropython.mjs");
const mp = await mp_mjs.loadMicroPython();

mp.runPython("print('hello world')");

Observed behaviour

see above

Additional Information

No, I've provided everything above.

@hoihu hoihu added the bug label Apr 23, 2024
dpgeorge added a commit to dpgeorge/micropython that referenced this issue May 2, 2024
Fixes issue micropython#14363.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge
Copy link
Member

dpgeorge commented May 2, 2024

Thanks for the report. Should be fixed by #14411.

@hoihu
Copy link
Sponsor Contributor Author

hoihu commented May 2, 2024

Thank you for the quick fix 👍

dpgeorge added a commit to dpgeorge/micropython that referenced this issue May 6, 2024
Fixes issue micropython#14363.

Signed-off-by: Damien George <damien@micropython.org>
dpgeorge added a commit to dpgeorge/micropython that referenced this issue May 6, 2024
Fixes issue micropython#14363.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge
Copy link
Member

dpgeorge commented May 6, 2024

Fixed by 9681a66

@dpgeorge dpgeorge closed this as completed May 6, 2024
@hoihu
Copy link
Sponsor Contributor Author

hoihu commented May 11, 2024

confirmed, that has fixed it, thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants