-
Notifications
You must be signed in to change notification settings - Fork 5
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
const instead of let in swipl-bundled.temp.js #5
Comments
If I clone the repo and manually fix this in the bundled file, I get this package to work, so very promising! |
Thanks for the report - the file is auto-generated from the build command in SWI-Prolog/npm-swipl-wasm#8; I am happy to accept a PR with your manual fix but it won't solve the underlying problem produced by either swipl-devel or emscripten; so I will also try and work out what the upstream cause is. In the meantime could you provide a minimal repro for this error (or even better would be a test case included with the PR doing the manual fix) so that we don't accidentally re-introduce the error when migrating to depend on npm swipl wasm |
Can you also test to see if you get the same error when using the node and web exports of SWIPL from https://github.com/rla/npm-swipl-wasm (as opposed to the bundled version used in eye-js). |
Aha - looks like the real bug is here https://github.com/SWI-Prolog/swipl-devel/blob/952794b3b03e6b073e767465b884cf81a0207737/src/wasm/prolog.js#L583 - so I will create a PR there with a fix; the manual patch PR here would also be useful in the meantime. |
I've made a PR #6 with the manual fix, it's pretty simple 😄 |
Thanks a lot for the quick actions. As promised, here is a working example of reasoning with EYE in the browser using this package (wrapped in another package @smessie/eye-js) https://reasoner.smessie.com. |
Happy to accept functions like that upstream here as well rather than having a bunch of micro-packages. Note that the logic you have seems to just be doing the same as // Load EYE into the SWIPL Module and run consule("eye.pl").
loadEye(Module)
// Load the the strings data and query as files data.n3 and query.n3 into the module
Module.FS.writeFile('data.n3', data);
Module.FS.writeFile('query.n3', query);
// Execute main(['--nope', '--quiet', './data.n3', '--query', './query.n3']).
queryOnce(Module, 'main', ['--nope', '--quiet', './data.n3', '--query', './query.n3']); Noting that |
Nice work! I am observing the page is taking a while to load since it is loading all the WASM before rendering; might be worth lazy loading the eye-js module or; using the browser version of SWIPL in https://github.com/rla/npm-swipl-wasm/ rather than the default bundle we export as that loads the WASM file separately using a fetch call. The |
Hi, thanks for making this package :)
When trying to use it, I'm getting following error
When I looked at that location, the error is correct, in
swipl-bundled.temp.js
the following code is included (formatted):As you can see,
size
is declared using aconst
and later on being reassigned.I'm not sure where to report this issue, but as I'm getting this error using this package, I'm reporting it here and then we'll see where the fix should happen in the end :)
The text was updated successfully, but these errors were encountered: