Bundling with LPeg fails (WORKED AROUND)

I did a fresh download of Defold.
Created a new Empty Project.
Added dependencies for the LPeg and Narrator assets.
I fetched the libraries.

The game runs in debug.

When I tried to bundle the project into a MacOS app, the process fails with the error:
The module ‘/LPeg.lua’ can’t be found.

Is the asset no longer usable?
What am I doing wrong?

What if you open the LPeg extension in Defold? Does the included example build?

Same error.

I have a memory of this happening when I switched to 1.4 Defold. I’m going to try it with last, 1.3.x.

I can’t download any version earlier than 1.3.6. I know I was making builds of a game that used LPeg, last year.

Looks like there was a new module added recently that tries to require("lpeg") which fails because that doesn’t work on native extensions. Does it work if you use the previous version?

2 Likes

I’ll try that. Thanks.
It’s easy to forget about how the on-demand libraries can suddenly undermine your game.

It’s also very easy to avoid by depending on a specific version of a dependency instead of the latest one :slight_smile:

Ah, but each asset page suggests and assists in setting a dynamic dependency. None point to a fine list of builds, such as the wonderful URL that you kindly provided.

So version 1.0.2 builds correctly on MacOS.
Now I will pray that Narrator doesn’t depend upon the 1.0.3 LPeg…

You’re right. We should promote this more.

1 Like

The asset pages now clearly link to the releases page for GitHub hosted assets:

2 Likes

Workaround - just add empty “lpeg.lua” file to your project.
Better approach - ask @astrochili to fix it :slight_smile:

1 Like

Or the best solution: Submit a PR with the fix!

1 Like

The rule was “Don’t touch what works fine,” but I broke it. The update is ready.

The topic can be merged with LPeg - A pattern-matching library :+1:

4 Likes