Npm dependencies in custom components

Hi, I’m having trouble implementing a custom component with a dependency to a third party library.

The particular library I’m trying to implement is anyline:
https://documentation.anyline.com/toc/platforms/react-native/getting_started.html

I managed to install the dependency with npm and it’s listed in the package.json
image

I also managed to connect my dev env with my adalo app and it’s displayed in the components menu:
image

I can also add the component to my app and it works until the anyline library is called, then there is an error.
image

The following error appears:

Seems like the library isn’t loaded.

How can the npm dependency in the project.json be loaded?

thanks
Wolfgang

I would need to see the code to know for sure. My guess is you are missing

import AnyOCR from 'anyline-ocr-react-native-module'

At the top of your index.js, once you add that you should get a new set of errors because this package does not seem like it supports react-native-web. What this means it that it will only work when you build your app and install it, not in the preview mode.

Thanks for your response. I did have the import in my index.js when I got this error message.
When I added ‘react-native’ to my dependencies, I got a different error message and got to the same conclusion as you, that it doesn’t support react-native-web. They to have a JS Web version though which I’m trying to implement now for the web preview. I’ll later try to build it and install it on android to see if the react-native version works.

I ended up using the JS Web version of anyline since there is no react-native-web support. The android build is still not working, but that’s another problem.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.