Skip to content
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

[Warning] Require is not defined #495

Open
smydolf opened this issue Jun 26, 2024 · 0 comments
Open

[Warning] Require is not defined #495

smydolf opened this issue Jun 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@smydolf
Copy link

smydolf commented Jun 26, 2024

Describe the bug
After build and successfully start app from TS example I've found a warning in the console.
Warning => require is not defined.

The warning comes from method called setOcUserAgent

const setOcUserAgent = chatSDK => {
  var _chatSDK$OCClient, _chatSDK$OCClient2;
  // eslint-disable-line @typescript-eslint/no-explicit-any
  if ((_chatSDK$OCClient = chatSDK.OCClient) !== null && _chatSDK$OCClient !== void 0 && _chatSDK$OCClient.ocUserAgent && !((_chatSDK$OCClient2 = chatSDK.OCClient) !== null && _chatSDK$OCClient2 !== void 0 && _chatSDK$OCClient2.ocUserAgent.join(" ").includes("omnichannel-chat-widget/"))) {
    try {
      const version = require("../../../package.json").version; // eslint-disable-line @typescript-eslint/no-var-requires
      const userAgent = `omnichannel-chat-widget/${version}`;
      chatSDK.OCClient.ocUserAgent = [userAgent, ...chatSDK.OCClient.ocUserAgent];
    } catch (error) {
      console.warn(error);
    }
  }
};

Screenshots
image

@smydolf smydolf added the bug Something isn't working label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant