Open Mizerness opened 1 year ago
Hello,
I hope you are well. I was trying to connect crisp-api to my NextJS project.
However, I got several errors including the fact that it could not find the "dns" package. So I installed it
Here is the code (quite messy but just for testing)
/* Location: lib/c.js */ var Crisp = require("crisp-api"); var CrispClient = new Crisp(); export default CrispClient;
/* Location: components/Crisp/crisp.js */ import { CrispClient } from "../../lib/c.js"; export default function RunCrisp() { return ( <div> {test} </div> ); } export async function getStaticProps() { const identifier = "XXX-XXX-XXXX-XXX"; const key = "XXX-XXX-XXXX-XXX"; CrispClient.authenticateTier("plugin", identifier, key); var test = await CrispClient.website .listConversations("XXX-XXX-XXXX-XXX", 1) .then(function (conversations) { console.log("Listed conversations:", conversations); }) .catch(function (error) { console.error("Error listing conversations:", error); }); return { props: { test, }, }; }
/* Location: pages/testcrisp.js */ import React from "react"; import RunCrisp from "../components/Crisp/crisp.js"; export default function TestCrisp() { return ( <div> <RunCrisp /> </div> ); }
And here is the error I have:
I try to do npm i dns but I just get another error saying that dgram is missing. What I see is that this package is deprecated.
npm i dns
dgram
Do you know what can I do to fix this ? Seems that some people using mongo-db package have the same issue.
Hello,
I hope you are well. I was trying to connect crisp-api to my NextJS project.
However, I got several errors including the fact that it could not find the "dns" package. So I installed it
Here is the code (quite messy but just for testing)
And here is the error I have:
I try to do
npm i dns
but I just get another error saying thatdgram
is missing. What I see is that this package is deprecated.Do you know what can I do to fix this ? Seems that some people using mongo-db package have the same issue.