Hello,
I have imported a javascript library to app.js and creating an instance from this library, however that stop LiveView from working, and a live route behaves like a regular http route
import {SomeObject} from "MyLibrary"
const someObject = new SomeObject()
Iam really wondered what can cause this strange behaviour, there is no errors or warnings at all, and once I put those 2 lines in a comment, everything returns to work normally including LiveView, also I confirmed that the library and the constructor works normally for another frameworks so where is the problem please ?
We’re going to need a bit more information than that to help you.
Can you show the full app.js file? What is the library? Are there any console errors in the browser?
Do you get past the constructor in your js file?
Thank you @kokolegorille,
I mentionned above that I didn’t have any errors or warnings logs, I have added just the two lines above to app.js, I didn’t use hooks before and I don’t have an idea about them and if they are suitable for my case which simply import and use js library, all what I know about hooks is we can use them to render external components like React’s ones, so if you can share some useful informations or tutorials about it I will be very thankful.
The library is to connect a digital wallet to phoenix app, GitHub - perawallet/connect: JavaScript SDK for integrating Pera Wallet to web applications.