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

[BUG] twilioError.ts:7 Uncaught TypeError: Object prototype may only be an Object or null: undefined #76

Closed
8 tasks done
rationalthinker1 opened this issue Feb 8, 2022 · 5 comments
Labels
bug Something isn't working jira added

Comments

@rationalthinker1
Copy link

  • I have verified that the issue occurs with the latest twilio.js release and is not marked as a known issue in the CHANGELOG.md.
  • I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • I verified that the Quickstart application works in my environment.
  • I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

Software versions:

  • Browser(s): Chrome
  • Operating System: Windows
  • twilio.js: 2.1.0
  • Third-party libraries (e.g., Angular, React, etc.): Vite

I am using Vite as a bundler. Out of the hundreds of packages that my application is using, only Twilio has this error.

image

twilioError.ts:7 Uncaught TypeError: Object prototype may only be an Object or null: undefined

I went through many hoops to get twilio working with Vite in the first place.

@rationalthinker1 rationalthinker1 added the bug Something isn't working label Feb 8, 2022
@rationalthinker1 rationalthinker1 changed the title [BUG] [BUG] twilioError.ts:7 Uncaught TypeError: Object prototype may only be an Object or null: undefined Feb 9, 2022
@mhuynh5757
Copy link
Collaborator

Thanks @rationalthinker1 , we'll look into supporting Vite. I've filed an internal ticket for this.

@charliesantos
Copy link
Collaborator

@rationalthinker1 are you still seeing this error?

@rationalthinker1
Copy link
Author

No, I had to dynamically import the twilio script files.

 protected importLibrary = async () => {
    await import('@twilio/voice-sdk/dist/twilio.min.js');
    Device = window['Twilio'].Device;
    Call = window['Twilio'].Call;
  };

@charliesantos
Copy link
Collaborator

Thanks @rationalthinker1 for providing your workaround. I submitted an internal ticket to properly address this.

@charliesantos
Copy link
Collaborator

This should be fixed now. Please see details here
#55 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira added
Projects
None yet
Development

No branches or pull requests

3 participants