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

pyxel.load error when running pyxel web #466

Closed
Ninjdai1 opened this issue Apr 26, 2023 · 8 comments
Closed

pyxel.load error when running pyxel web #466

Ninjdai1 opened this issue Apr 26, 2023 · 8 comments

Comments

@Ninjdai1
Copy link

Ninjdai1 commented Apr 26, 2023

Hi,
I'm getting an error when trying to load pyxel web : when loading either pyxel-play or pyxel-editor, I get these messages :

Player output :

Traceback (most recent call last):
  File "/lib/python3.10/_pyodide/_base.py", line 460, in eval_code
    .run(globals, locals)
  File "/lib/python3.10/_pyodide/_base.py", line 306, in run
    coroutine = eval(self.code, globals, locals)
  File "", line 3, in 
  File "/lib/python3.10/site-packages/pyxel/cli.py", line 166, in run_python_script
    runpy.run_path(python_script_file, run_name="__main__")
  File "/lib/python3.10/runpy.py", line 269, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "app.py", line 230, in 
    App(216038)
  File "app.py", line 208, in __init__
    pyxel.load("./res.pyxres", True, True, False, False)
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }

Editor output :

Traceback (most recent call last):
  File "/lib/python3.10/_pyodide/_base.py", line 460, in eval_code
    .run(globals, locals)
  File "/lib/python3.10/_pyodide/_base.py", line 306, in run
    coroutine = eval(self.code, globals, locals)
  File "", line 3, in 
  File "/lib/python3.10/site-packages/pyxel/cli.py", line 221, in edit_pyxel_resource
    pyxel.editor.App(pyxel_resource_file, starting_editor)
  File "/lib/python3.10/site-packages/pyxel/editor/app.py", line 46, in __init__
    pyxel.load(resource_file)
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }

Here is the page I'm trying to load (player.php):

<!DOCTYPE html>
<html>
    <head>
        <title>Billy: Story Mode</title>
        <script src="https://cdn.jsdelivr.net/gh/kitao/pyxel/wasm/pyxel.js"></script>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body>
        <pyxel-run root="./app" name="app.py"></pyxel-run>
    </body>
</html>

When loading a script that doesn't use pyxel.load, it works fine.
I'm hosting the pages I'm trying to load on a GNU/Linux machine (debian Bullseye) with an nginx server.
However, I don't get this error when running the same exact website on a windows machine with Apache :/

Any idea on why this is happening / how to fix this ?
And yes, I already checked whether the client had access to the res.pyxres file, and it does

EDIT: Just noticed #462 , would it resolve the issue ?

@Ninjdai1 Ninjdai1 changed the title Error when running pyxel web pyxel.load error when running pyxel web Apr 27, 2023
@kitao
Copy link
Owner

kitao commented Jan 12, 2024

It seems like an error that occurs when opening Pyxel 2.x resource files in Pyxel 1.9.

@Ninjdai1
Copy link
Author

It's an error that occured in Pyxel 1.9.14. I don't know if this still happens

@kitao
Copy link
Owner

kitao commented Jan 12, 2024

I believe it was likely a lag due to the CDN updating after a Pyxel version upgrade. Usually, this takes about 8 hours. I think it should not occur anymore.

@Ninjdai1
Copy link
Author

I believe it's up to date and still happening ? It's an almost 1 year-old bug, and it still happened multiple days after the update...
See https://ninjdai.ynh.fr/~/billy_storymode/player.php

@kitao
Copy link
Owner

kitao commented Jan 12, 2024

I'm not sure. Because I dont't know which version of Pyxel is used to make the used resource file.
First of all, does the resource file works on the native Pyxel, not on Web?

We need to determine whether the problem is due to the Web or some other factor.

@Ninjdai1
Copy link
Author

It did work on native pyxel, but again this is a year-old issue that may be already resolved/caused by a wrong version of pyxel on my end.
I'll do some testing and post here my results

@kitao
Copy link
Owner

kitao commented Jan 12, 2024

I'd like to know your app works with the latest Pyxel on Native environment because Web version of Pyxel always uses the latest Pyxel.
Does it work?

@kitao
Copy link
Owner

kitao commented May 11, 2024

Let me close this issue since there's no reports on the latest Pyxel.

@kitao kitao closed this as completed May 11, 2024
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

2 participants