-
Notifications
You must be signed in to change notification settings - Fork 15
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
window.$crisp.is is not a function #11
Comments
Can you please provide all your code? |
My App.tsx
Next, I have a button in a bottom bar. It's when I click on this button, that sometimes, randomly, I get the error message window.$crisp.is not a function
|
Are you using Next.js? |
No i'm not. React only. On the other hand, the issue occurs only when the project is built, but never in dev. |
Could it be a linter issue?
Seems you are not using the configure in a lyfecyle hook, so it could be possible the builder tries to evaluate the code, even if it’s not mounted in the dom.
--
Baptiste Jamin
… On 9 Feb 2023, at 10:12, RobinChailley ***@***.***> wrote:
No i'm not. React only. On the other hand, the issue occurs only when the project is built, but never in dev.
—
Reply to this email directly, view it on GitHub <#11 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAGTRQ3ZYPIAKPPRFQ2WOULWWSYJFANCNFSM6AAAAAAUWIV3RU>.
You are receiving this because you commented.
|
I tried to use the configure function in a life cycle hook, but it does not change anything. However, I found that the error occurred after browsing via a Link, or whatever, from react-router-dom. If I browse the app using a "a" with href="..."/, I don't get the error. If I console.log() into my window.$crisp browser console before I've navigated using react-router-dom, then I get this result: {push: ƒ, get: ƒ, set: ƒ, is: ƒ, on: ƒ, ...} which seems to be the expected result, and it works, then "is" is indeed a function. On the other hand, if I console log again, but after navigating with react-router-dom, I have this result there : [Array(2), Array(2), Array(2), Array(2), Array(2), Array(2)] And so the error "window.$crisp.is is not a function". |
I might have the same issue on a Next.js project. Calling methods only on client side.
crisp-sdk-web: 1.0.12 |
@RobinChailley @loiclouvet Have you found a solution? |
Hey! Do you run the latest SDK version? |
@baptistejamin 1.0.20, but in my situation Chat is opening on the second try :/ |
Would it be possible to get more context? It could be possible you are trying to call Crisp methods way before the window is ready |
@baptistejamin
Then I'm checking if Crisp is injected and I'm rendering HelpButton
HelpButton component has handle click function
And renders button
|
Hi, our agents are offline at the moment. Please leave a message and we will get back to you as soon as possible. |
@baptistejamin any update? :) |
Would you be available for a live debug session? You can contact any time at baptiste@crisp.chat |
@SzymonNiemiec @baptistejamin did you figure out what was causing this? |
In general such issues are because of server side rendering Sent from my iPhoneOn 9 Apr 2024, at 10:38, Deepit Patil ***@***.***> wrote:
@SzymonNiemiec @baptistejamin did you figure out what was causing this?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I am working on a React application, on which I have installed crisp-sdk-web. Sometimes, randomly, I can't open the chat anymore, and I have the following error message in the console, while sometimes, everything works perfectly. The behavior seems random:
I did call Crisp.configure() with the uuid in my App.tsx.
The text was updated successfully, but these errors were encountered: