Packages: primitive value & undefined errors


I’m trying to implement HubSpot’s live chat feature but I’ve been getting some weird errors:

They seem to related to the Meteor packages installed and Minimongo but I can’t figure out why the HubSpot implementation would be causing these errors because it does not interact with the database nor these packages.

I include the main HubSpot script using a tag and another custom script using a tag too.

A basic React component is shown to start the live chat. It renders a different loading image whilst it waits for the HubSpot script to fully load.

Has anyone else encountered these errors before?


What’s the custom script?

And could you perhaps load the script on your front-end (React or whatever) rather than as a script tag to see if that makes a difference?


The custom script handles some styling for the livechat widget and sets up an event listener.

I imported that from the front-end instead of a tag but the error is still thrown. Removing the custom script entirely still throws the error.

Removing the HubSpot specific script prevents the error so it must be that (for some reason?).

This is how it’s included:

<script type="text/javascript" id="hs-script-loader" async defer src="//path/to/"></script>

It’s included at the bottom of the tag.


What I’m suggesting is to not include it as a script tag but add it after your app has mounted. It may throw more light into what’s happening.