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

Workaround for build errors when using Deep Chat #9

Closed
OvidijusParsiunas opened this issue Aug 31, 2023 · 1 comment
Closed

Workaround for build errors when using Deep Chat #9

OvidijusParsiunas opened this issue Aug 31, 2023 · 1 comment
Assignees
Labels
advice Information how to use/implement the component

Comments

@OvidijusParsiunas
Copy link
Owner

OvidijusParsiunas commented Aug 31, 2023

After importing Deep Chat - some projects that target older versions of JavaScript or use specific configurations can encounter new build errors.

@OvidijusParsiunas OvidijusParsiunas self-assigned this Aug 31, 2023
@OvidijusParsiunas OvidijusParsiunas added the documentation Improvements or additions to documentation label Aug 31, 2023
@OvidijusParsiunas
Copy link
Owner Author

OvidijusParsiunas commented Aug 31, 2023

SOLUTION:
Use one of the following approaches to fix build issue you are experiencing:

  • Dynamically download the Deep Chat module via a script instead of a project dependency which will prevent Deep Chat from being evaluated during build time. Configure your framework of choice to append the following <script> tag to the <head> element:
    <script type="module" src="https://unpkg.com/deep-chat@1.1.20/dist/deepChat.bundle.js" ></script>
    Please note that scripts can take time to download, so if you are seeing problems with your properties not being applied in time, we advise you to attach an onload listener to the <script> tag so you can conditionally render the <deep-chat> code when it loads. You can achieve this by; giving the <script> an id, searching for it using document.getElementById and then adding onload to the result element. Check a live example for this in Vue 2.
  • Older build tools/loaders/transpilers have problems using newer JavaScript syntax, one way to overcome the problem is by simply upgrading them.

If you are experiencing other problems or have your own solutions, do not hesitate to comment below or create a new issue.

@OvidijusParsiunas OvidijusParsiunas changed the title Workaround for building a project that uses ES5/ES2015 JavaScript Workaround for build errors when using Deep Chat Aug 31, 2023
@OvidijusParsiunas OvidijusParsiunas added advice Information how to use/implement the component and removed documentation Improvements or additions to documentation labels Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advice Information how to use/implement the component
Projects
None yet
Development

No branches or pull requests

1 participant