How to resolve range Issue in node_module/webpack-dev-middleware/lib/util.js/131 - angular9

I have a build issue while running a unit test case in angular 9.
environment
Angular CLI: 9.1.12
Node: 15.1.0
OS: win32 x64
error:

Same error was coming for me too. I commented the if else block in nodemoodules/webpack-dev-middleware/lib/util.js 130. It is because it has undefined value. Now it is working fine. I am beginner, I don't know about the impact else where.

It's an issue with karma on node v15, you'll have to downgrade to 14.
Issue at Karma: https://github.com/karma-runner/karma/issues/3571
See also: [karma-server]: TypeError: Cannot read property 'range' of undefined - Angular Unit Testing in CI environment

Related

Package error IOS_13 on Windows platform only

I just updated the project to 5.0 from 5.0EA. While in editor everything runs fine but I tried to package it for some testing, and I’m getting the following error, even tho in Project Settings I only have checked Windows as platform. I wasn’t getting this error before, is there something I’m missing?
LogClass: Warning: In asset ‘None’, there is an enum property of type ‘EIOSVersion’ with an invalid value of ‘IOS_13’
LogObj: Error: LoadConfig (/Script/IOSRuntimeSettings.Default__IOSRuntimeSettings): import failed for MinimumiOSVersion in: IOS_13
I uninstalled UE5 and then removed all of it's files from AppData, reinstalled it and the problem is gone. I don't know why it was trying to use IOS too even tho it wasn't checked but at least that was the solution for me. Just uninstalling are reinstalling wasn't enough.

How to fix Kotlin REPL exception NoClassDefFoundError

I'm attempting to run the Kotlin REPL on my windows 10 machine, from the command line. I am receiving a java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder exception when running the command kotlinc
I have IntelliJ Ultimate 2019.1.3 installed, with the Kotlin plugin. I have the Kotlin standalone compiler also installed and I've added that location to my system path. I've tried to run the command from the standalone directory: "C:/Tools/kotlinc/bin" but no difference.
OS Name: Microsoft Windows 10 Enterprise
Version 10.0.16299 Build 16299
Kotlin version 1.3.40-release-123 (JRE 1.8.0_131-b11)
java version "1.8.0_131"
I expect the REPL to start without an exception. What could be causing the exception?
Thank you all!
It looks like that was a bug and it has been fixed with Kotlin plugin & kotlinc version 1.3.41 (released today).

Angular 6 - Uncaught ReferenceError: module is not defined vendor.js

I have recently upgraded a .net Core (2.1) / Angular 6 SPA app to the latest versions. I seemed to have done everything correctly at one point, but I made a change that broke the http (port 5000) app. I get an error:
vendor.js:1 Uncaught ReferenceError: module is not defined
at vendor.js:1
This is the first line of the vendor.js file. When I run the app using port 5001 (https), everything seems to work fine. I cannot figure out why there is a difference in the two websites as they are hitting the same code base.
To begin this upgrade, I started with the official dotnet core 2.1 Angular SPA and upgrade angular from 5 to 6.
I had this exact error and fixed it by changing the port number for the App URL in the Project Properties.
Hope this helps, however I'm still not sure what caused the issue.

Metadata mismatch problems - Angular

I am getting the usual error:
ERROR in Error: Metadata version mismatch for module C:/.../node_modules/#ng-bootstrap/ng-bootstrap/index.d.ts, found version
4, expected 3, resolving symbol AppModule in C:/.../app.module.ts, ...
I have looked at other posts on here with regards to version differences in the package.json file, however I am unsure which is causing the issue.
You can see from the github page that bootstrap expects angular version 5.0.2 and you are using 4.2.4. So probably upgrading to angular 5 will solve your issue.
https://github.com/ng-bootstrap/ng-bootstrap/blob/master/package.json

Error using karma-browserify with browserify-shim

I'm trying to use karma-browserify together with browserify-shim with no success. Here is a repo to reproduce the error: https://github.com/pelizza/karma-browserify-shim
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
TypeError: undefined is not an object (evaluating 'module.exports = ex')
at /var/folders/_0/ql88mbyd6v34qsmysr5kf4780000gn/T/e0c5e5ebe3f49930de3d988c7196737f.browserify:40308 <- bower_components/jquery/dist/jquery.js:9837:0
Everything works fine when bundling with browserify, by it seems that karma simply doesn't find shimmed dependencies when preprocessing files with karma-browserify.
I couldn't find much about this problem, except this one at stack overflow, without a solution: karma-browserify throws error when trying to load modules shimmed with browserify-shim
Found the solution: just remove the browserify-shim transform from the karma configuration file if it was already declared as a transform on package.json.
I have updated the repo with this fix.
Here is the discussion about this issue: https://github.com/nikku/karma-browserify/issues/170#issuecomment-187372309