"Unable to convert object into a primitive value" error message appears on Internet Explorer

Currently working on a webpage using Angular 7. The code is functioning perfectly in Chrome, however, I am facing an Exception error while running it in IE:

An issue arises: Can't convert object to primitive value (polyfills.ts)

The source of the error is unclear to me...

I came across a thread suggesting that all classes need a toString method, which I added, but it did not resolve the issue. I also removed all ${}... with no success.

IE Console: IE Console Error Screenshot

Debugger: Debugger Screenshot

Answer №1

Surprisingly, the issue turned out to be related to a specific line in index.html:

<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true&key=MY_KEY&libraries=places&language=de_DE"></script>

Simply removing this line resolved the problem. However, since it was necessary, I dynamically added it back via JavaScript. This unconventional fix did the trick... Definitely unexpected!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Transforming TimeZone Date Object without Altering Time

I am looking to change the time zone of a date from one timezone to another. For example: "Sun May 01 2019 00:00:00 GMT+0530 (India Standard Time)" is the current date object. I want to convert this date based on a specific timeZone offset, let's say ...

Navigating through Angular to access a component and establishing a data binding

I am looking for the best way to transition from one component to another while passing data along with it. Below is an example of how I currently achieve this: this.router.navigate(['some-component', { name: 'Some Name' }]); In Some ...

How can I create interfaces for deeply nested objects in TypeScript?

Check out my current JSON data below: { "state_1": { "date": [ { 1000: { "size": 3, "count": 0 } }, { 1001: { "size" ...

Question about using jQuery and CSS with an Internet Explorer compatible PNG image

function fadehomepage() { //Fade out the elements initially by setting opacity to 0 $('#showcase_home > div > a').css({'opacity':'0'}); $('#showcase_home > div').hover( ...

How to correct placeholder text display in the input of a Material UI text field

Currently, I am utilizing the material ui text field component. The issue at hand is that when the text field is in focus, the placeholder shifts to the top of the field. https://i.stack.imgur.com/P5flf.png I prefer for the placeholder to remain within ...

What is the most effective method for designing a scalable menu?

What is the most effective way to create a menu similar to the examples in the attached photos? I attempted to achieve this using the following code: const [firstParentActive, setFirstParentActive] = useState(false) // my approach was to use useState for ...

The functionality of "subscribe()" is outdated if utilized with "of(false)"

My editor is flagging the usage of of as deprecated. How can I resolve this issue and get it working with of? public save(): Observable<ISaveResult> | Observable<boolean> { if (this.item) { return this.databaseService.save(this.user ...

Is there a method we can use to replace fixture fields with data created during the test case to produce a dynamic payload? (Already attempted existing solution)

I am new to using Cypress and I'm wondering if there is a way to generate a dynamic payload by replacing values in a JSON file with values generated programmatically in a Cypress test. This is similar to what we do in Rest Assured by substituting %s i ...

Using relative URLs in Angular 2 CSS

Struggling in Angular 2 to set a background image for a division using a .css file in the component, but encountering errors due to relative paths. test.component.html <div class="release-bg"></div> test.component.css .release-bg{ b ...

Running an Angular 2 application locally without using Node? Here's how you can do

After completing a tutorial on creating a movie finder app using Angular 2, I found that the project could only be viewed by running 'npm start' in command line. Is there a way to allow others to view my project locally on their machines even if ...

Creating an Angular feature module with the aim of converting it into an Angular library

Currently, I am developing an angular feature module as a library to enable us to create individual modules without the need to rebuild the entire angular application. While this approach seems to be functioning well, my question is whether it is conside ...

The NgRX Effect is malfunctioning

Working on integrating ngrx with Angular. Authentication is successful, but facing issues with product store implementation: Organizing the project using modules: const routes: Routes = [ { path: '', redirectTo: 'home', ...

Presenting CSV data in a tabular format using Angular and TypeScript

I am facing an issue with uploading a CSV file. Even though the table adjusts to the size of the dataset, it appears as if the CSV file is empty. Could this be due to an error in my code or something specific about the CSV file itself? I'm still learn ...

Can you explain the distinction between implementing tab content styles?

My method for displaying tab content is as follows: <mat-tab-group> <mat-tab label="First"> <ng-template matTabContent> The First Content </ng-template> </mat-tab> </mat-tab-group> What sets this apar ...

experimenting with a TypeScript annotation

I have created a simple decorator that can trigger either stopPropagation() or preventDefault() based on certain conditions. I have thoroughly tested this decorator in my application and am confident that it works correctly. However, I encountered an issue ...

Divide Angular component unit test involving asynchronous tasks

One of my components is responsible for fetching data from a server using a service and then displaying it. I have created a test for this component which ensures that the data is loaded correctly: ... it('Should contain data after loading', as ...

Unleashing the Power of Firebase Service in Angular Components: A Guide to Effective Unit Testing

I am currently working on testing my Create-User-Component which relies on an Auth Service that includes methods like 'login, logout,' etc. The Auth Service imports both AngularFireAuth and AngularFirestore, and it is responsible for handling da ...

Utilizing Dynamic Variables in Angular Module Declarations

I am facing an issue with importing a module in my @NgModule setup. Currently, I have the following code: MqttModule.forRoot(environment.MQTT_SERVICE_OPTIONS) However, I want to retrieve the value from a configuration file instead of the environment. To ...

What is the reason for the return of undefined with getElementsByClassName() in puppeteer?

Currently, I am utilizing puppeteer to fetch certain elements from a webpage, specifically class items (divs). Although I understand that getElementsByClassName returns a list that needs to be looped through, the function always returns undefined for me, e ...

Troublesome situation created by JQuery AJAX incompatibility with Internet Explorer

I am currently working on a form that interacts with a SQL Table. JavaScript: <script> $(document).ready(function(){ function fetch_data() { $.ajax({ url:"select.php", method:"POST", cach ...