Published App Missing Dependency

I have an app that runs perfectly in the IDE, but when I publically publish it the main dependency is missing and I get this error :

ExternalError: ReferenceError: Tabulator is not defined

The dependency in question is the wrapper around a JS library, and as I say it works perfectly in the IDE.

Must I do something extra when publishing an app containing such a dependency?

I was wondering if the main app needed a copy of the Native Libraries code present in the dependency, though I don’t know if that would make sense. I’m trying to find the thread where that was mentioned (from ages ago).

Here’s one such discussion : https://anvil.works/forum/t/native-libraries/2284/2?u=david.wylie where the implication was that was about to be “fixed”.

And I think Ian’s first comment Re-using a custom component suggests a fix, ie dependent app requires the library headers as well.

edit - none of that worked :slight_smile:

1 Like

Depending apps do get the Native Libraries of dependencies, but they don’t inherit the Assets (for now). Maybe that’s the issue? Alternatively, are you sure you’re depending on the right version of your dependency in your published vs dev code? (You can depend on the published or dev versions of a dependency - it’s possible only one is working)

A Clone link would help…

1 Like

I was depending on the dev version of the library, both in IDE and published. I’ve changed that to the dev version and the issue remains.

I really don’t want to share a clone link - the code is awful, full of experimental stuff and half way through a massive refactoring exercise…ok, ok, I’ll share it privately, but you have to promise not to laugh…

1 Like

Ok, this simple app demonstrates the problem :

https://anvil.works/build#clone:HIBZ6DZMSQFB3R7K=J22QST6LMY3CZIWGI54MNENQ

Dependency :

https://anvil.works/build#clone:BDJKNBLN2TYAWXFW=TG3IHVVX2QSFKDRBEO4UHHRW

It runs in the IDE but not when published.

edit - ok, I’m getting :
Loading failed for the <script> with source “https://unpkg.com/tabulator-tables@4.5.3/dist/js/tabulator.min.js”

in the browser debug, yet it loads fine directly in the browser and when the app is run from the IDE.

The dependency loads it with this line in Native Libraries :

<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.5.3/dist/js/tabulator.min.js"></script>

Solved.

Beware the perils of using uBlock Origins. It’s great, but it will bite you every so often.

In this instance I had not set my new domain to allow unpkg domain through. Hence the non-loading of the library.

I shall shuffle off into the corner now wearing a big, pointy, “D” emblazoned hat …

1 Like