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

How can I handle require()? #43

Open
FrancoisMentec opened this issue Jan 6, 2020 · 1 comment
Open

How can I handle require()? #43

FrancoisMentec opened this issue Jan 6, 2020 · 1 comment
Labels

Comments

@FrancoisMentec
Copy link

FrancoisMentec commented Jan 6, 2020

When I try to load this file (https://github.com/LocalIdentity/PathOfBuilding/blob/master/Modules/Common.lua) I'm getting this error :

uncaught exception http://localhost:3000/PathOfBuilding/Modules/Common.lua:23: module 'lcurl.safe' not found:
	no field package.preload['lcurl.safe']
	no file './lua/5.3/lcurl/safe.lua'
	no file './lua/5.3/lcurl/safe/init.lua'
	no file './lcurl/safe.lua'
	no file './lcurl/safe/init.lua'
	no file './lua/5.3/lcurl/safe.js'
	no file './lua/5.3/loadall.js'
	no file './lcurl/safe.js'
	no file './lua/5.3/lcurl.js'
	no file './lua/5.3/loadall.js'
	no file './lcurl.js'
w @ fengari-web.js:8
I @ fengari-web.js:8
(anonymous) @ fengari-web.js:8
C @ fengari-web.js:8
MutationObserver.observe.childList @ fengari-web.js:8

I followed the Getting started from your website https://fengari.io/, but replaced "/my-script.lua" with the file I linked previously. The error come from require, the script I try to run want to load some external library, how can I handle that? Is there a function to tell fengari that a script tag corresponds to a specific extension? Also, I know nothing about Lua, I just want to run a project written in Lua in a browser extension and your project looks like what I need.

@FrancoisMentec FrancoisMentec changed the title lcurl 404 not found How can I handle require()? Jan 6, 2020
@daurnimator
Copy link
Member

Your script tries to load the lcurl.safe library: you would need to provide this library somehow (or some compatibility layer for it).

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