3

If I used jquery-1.9.1.min.js getting JavaScript runtime error: Unable to get property 'opera' of undefined or null reference from Jquery Isotope v1.5.19 javascript file. If I use https://ajax.

I am using the aspnetcore-spa template, creating a project with the command 'dotnet new angular'. See https://jonhilton.net/2017/02/21/create-a-vs2017-angular-2-and-net-core-site-using-the-command-line/. The current set of templates is version 1.0.3, which adds Angular 4.1.2 to the npm dependencies. This works great to get a project running quickly.

Unable to get property 'getfullyear' of undefined. Helpful resources. SBX - Ask Questions. Community Forums. SBX - RBE Personalized Column Equal Content Card. Unable to get property 'getfullyear' of undefined or null reference. First thing you need to see why req.body.text is null or undefined, then you do the empty check like below. Const isEmpty = (str: string): boolean = console.log.

Property

However, right out of the box, the 'counter' page does not work with IE 11. If you navigate to the 'counter' link, and look at IE's console, you will see the message: 'Unable to get property 'apply' of undefined or null reference'. And when you click the 'Increment' button, nothing happens. (It works fine for Chrome and Firefox, but not IE.)

I did some digging, and it seems that the root of the problem is that the .assign method is not implemented in IE11. See Angular2 IE11 Unable to get property 'apply' of undefined or null reference

The fix, according to the link above, is to import the Object.assign polyfill by MDN. However, I don't know how to accomplish that in the project. What I have tried is:

1) Add to package.json: 'mdn-polyfills': '^3.5.0'

2) Add 'mdn-polyfills' to webpack.config.vendors.js

3) Run 'webpack --config webpack.config.vendor.js' from a command prompt at the root of the project folder, which results in an error:

I don't know what to do next. Steps 1 and 2 above do not resolve the problem. I tried adding to app.module.shared.ts the following:

This compiled fine, but did not help anything. I am not planning to use the counter page anyway, of course, but I get the same error (in IE 11 only) on a form I have created in a component I actually do care about.

So, once again, I am left to struggle with how to set up an environment that works, rather than actually coding Angular components. Oh, how I miss the days when I could just add a package via NuGet and it would just work!

If anyone can help, it would be most appreciated.

UPDATE: After finding this: https://www.npmjs.com/package/es6-object-assign, I added 'es6-object-assign': '1.1.0' to package.json, then added 'es6-object-assign' to webpack.config.vendors.js, then ran webpack --config webpack.config.vendor.js' from a command prompt (no errors). I then added the following at the top of my app.component.ts file:

None of it made any difference. I still get 'Unable to get property 'apply' of undefined or null reference' error. I also note that this error appears on every single page, though it only seems to impact functionality of the counter page (Increment button does nothing).

I have verified that the source of the problem is indeed the .assign method. The error is coming from the vendor.js file, at the return line below:

There must be a way to fix this, but I am at a loss...

NEW UPDATE: I am confident that this is not the right way to address this issue, but in desperation I just added a script at the top of my _Layout.cshtml page, which I found here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign

This does fix the issue, and makes the counter page work correctly, but it is clearly not the 'Angular way', so I am not considering this solution to be an answer to my question. If anyone can show me the right way to solve this problem, I would consider that the answer.

3 answers

4

Для того , чтобы решить проблемы с vendor.jsв функции

Одним из решений является работа с polyfills.tsкак говорит здесь

Но во многих случаях не polyfills.tsфайл ... Так что в этом случае решение , которое работает для меня это ....

Под ClientAppдиректорию решения есть файл с именем

Под линией 2, что говорит

Добавь это

И это должно работать.

0

Может быть, это: в CMD строке перейдите в папку шаблона проекта aspnetcore-спа

C: Users Jo angularDemos2> DotNet восстановить

Для того, чтобы снести все пакеты NuGet

затем введите

Unable To Get Property Trim Of Undefined Or Null Reference Example

C: Users Joffr angularDemos2> НПМ установки

Для того, чтобы снести все зависимости от файла JASON

0

Unable To Get Property Trim Of Undefined Or Null Reference Sheet

На самом деле Сначала убедитесь, что с помощью EDGE и не IE это должно решить вас CONCAT вопросов в файле Vendor.js.

Error Unable To Get Property 'trim' Of Undefined Or Null Reference

Для получения дополнительной информации используйте г-н Май Tutorial