Angular 12: RangeError: Maximum call stack size exceeded - caching

I am getting this error when building:
Generating browser application bundles (phase: building).../home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:21
const lines = source.match(SPLIT_LINES_REGEX);
^
RangeError: Maximum call stack size exceeded
at String.match (<anonymous>)
at streamChunksOfSourceMapFull (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:21:23)
at module.exports (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:389:6)
at SourceMapSource.streamChunks (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/SourceMapSource.js:211:11)
at module.exports (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunks.js:13:17)
at ReplaceSource.streamChunks (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/ReplaceSource.js:176:44)
at module.exports (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunks.js:13:17)
at streamAndGetSourceAndMap (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamAndGetSourceAndMap.js:27:53)
at CachedSource.streamChunks (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/CachedSource.js:208:35)
at module.exports (/home/jde/edApp2Angular12/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunks.js:13:17)
I've been looking around for an answer but it seems to always be "You have an infinite loop somewhere in your code". But the output from this error suggests that it comes from webpack and therefore not from a bug I my project.
How do I figure out what is wrong? Where do I go from here?
Angular version: 12.2
Webpack version: 5.47.1
UPDATE: It compiles with aot if I turn off sourcemaps
UPDATE: I am not using Angular 12.1 as first stated. It is actually version 12.2. I can also conclude that I am suffering from this bug: https://github.com/webpack/webpack-sources/issues/131

A fix for the bug I mentioned has now been released. In v3.2.1 of webpack they have removed the regex causing the trouble. I ran an npm update yesterday, and the error went away.

Related

Displaying Most NODE_OPTIONs are not supported in packaged apps error after npm command

"Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details." error is displaying in the vs code console after I enter the npm.
This issue comes up after I installed cypress version 9.4.1. The code is running fine but every time I run the code this error message comes up.
Why this issue is displaying and can someone explain to me how to fix this, please?
I solved this problem
But the point is that I use Angular version 14
I run the command ng e2e to solve this problem
Then I selected cypress among the suggested options in the command line

VeracityLearning LRS (LRS.io) local installation

I'm trying to install the Veracity Learning LRS locally (on Windows). I followed this guide exactly, and MongoDB is installed and running with no apparent problems. However, I get a strange TypeError when I try to save the configuration:
Console: at processTicksAndRejections (internal/process/task_queues.js Some OSs will require you to run with administrator rights to bind to your selected port.
Console: at processTicksAndRejections (internal/process/task_queues.js Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
at Function.assign (<anonymous>)
at v (C:\snapshot\lrs2\build\lite\manager.js:2185:795751)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async C:\snapshot\lrs2\build\lite\manager.js:2185:796007
The given file locations don't exist on my machine, so I don't know where to look to debug this. I've also tried to run the command prompt as administrator, which removes the first message but not the second. Has anyone encountered this issue before? I'm also not committed to the Veracity LRS, so I'm also open to suggestions for a simpler installation; this was only supposed to be for testing.
I'm from Veracity, and this is an issue that cropped up on some configurations a while ago, but we've not seen it in a long time, so either the bug has reappeared or you just have an older version.
If you're not using 1.10.x, make sure to try the latest version.

Nativescript application crashes with "Encountered undefined provider!" before module loaded on IOS but works on Android

I am using nativescript 5.1.1 with android version 5.1.0 and ios version 5.1.1. When the application starts on ios it immediately crashes with the following error:
JavaScript stack trace:
1 _reportError#file:///app/tns_modules/#angular/compiler/bundles/compiler.umd.js:19223:31
2 #file:///app/tns_modules/#angular/compiler/bundles/compiler.umd.js:19072:43
3 forEach#[native code]
4 _getProvidersMetadata#file:///app/tns_modules/#angular/compiler/bundles/compiler.umd.js:19057:30
5 getNgModuleMetadata#file:///app/tns_modules/#angular/compiler/bundles/compiler.umd.js:18776:84
6 _loadModules#file:///app/tns_modules/#angular/compiler/bundles/compiler.umd.js:26060:74
7 _compileModuleAndComponents#file:///app/tns_modules/#angular/compiler/bundles/compiler.umd.js:26041:52
8 compileModuleAsync#file:///app/tns_modules/#angular/compiler/bundles/compiler.umd.js:26001:68
9 bootstrapModule#file:///app/tns_modules/#angular/core/bundles/core.umd.js:17836:42
10 _bootstrapper#file:///app/tns_modules/nativescript-angular/platform-common.js:87:50
11 #file:///app/tns_modules/nativescript-angular/platform-common.js:150:32
12 notify#file:///app/tns_modules/tns-core-modules/data/observable/o<…>
JavaScript error:
file:///app/tns_modules/#angular/compiler/bundles/compiler.umd.js:19223:31: JS ERROR Error: Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Additionally when looking at the console from the device i see this.
[19-02-08 11:56:23.932] (CLI) (node:39256) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'pipe' of undefined
at WebSocketServer.server.on (/usr/local/lib/node_modules/nativescript/lib/device-sockets/ios/app-debug-socket-proxy-factory.js:124:32)
at WebSocketServer.emit (events.js:182:13)
at handleUpgrade (/usr/local/lib/node_modules/nativescript/node_modules/ws/lib/websocket-server.js:79:18)
at WebSocketServer.completeUpgrade (/usr/local/lib/node_modules/nativescript/node_modules/ws/lib/websocket-server.js:293:5)
at options.verifyClient (/usr/local/lib/node_modules/nativescript/node_modules/ws/lib/websocket-server.js:210:16)
This doesn't seem to be in my module because it runs properly in Android.
I'm mainly looking for some help in debugging the issue. I don't have any way to debug the dynamic code being pushed to the emulator or phone.
What are the versions of the following packages:
nativescript-angular, nativescript-dev-webpack and angular?
You mentioned you updated nativescript but maybe you should update the above mentioned packages as well.
I figured it out. There was an import of the AndroidApplication class without a platform check. The error that was thrown was just not great. If someone else comes across this perhaps that will help.

Using Babel in Production - How to precompile scripts

I'm building an application using Oracle Application Express (APEX) [so no existence of Node].
I have two issues which are somehow related concept-wise.
Issue #1:
I've included the React.js library in all of my pages to use some of its features.
I'm using babel to convert my JSX to simple JS. Everything's working fine.
But I keep on getting this warning in my console :
You are using the in-browser Babel transformer.
Be sure to precompile your scripts for production - https://babeljs.io/docs/setup/
I know I must precompile my scripts but I have no idea how. I visited the link and it got me all the more confused.
Issue #2:
The other issue I have is that I've got all my react related code in a separate .js file and I have embedded it in my page using this :
<script src="someJSFile.js" type="text/babel"></script>
Setting the type to "text/babel" raises this warning :
Fetching scripts with an invalid type/language attributes is deprecated
and will be removed in M56, around January 2017.
See https://www.chromestatus.com/features/5760718284521472 for more details.
Is there any workaround for this issue?
Issue 1: This is linked to what ever bunlder you choose (see issue 2 below). Which ever you do choose, will allow you to set the node env to production, which will put React in "production" mode - basically scraping out all the unneeded (but helpful) development messages and checks.
Issue 2: You will need some module bundler at the end of the day. Webpack is the goto at the moment. Webpack Site
Alternatives include:
Gulp + Browserify
Rollup
EDIT: I know you said "no node". You won't need node to run anything on the server, only on your local machine where you build the files. Node is easy to install on pretty much any local machine

Jasmine suddenly throwing errors, mostly on toHaveBeenCalledWith

We cleared and rebuilt our dependency trees yesterday, and we've suddenly starting seeing these types of jasmine errors, mostly on calls to toHaveBeenCalledWith.
20) should call callback on modal success
Email Campaign Preview Controller showSuccess function
TypeError: undefined is not a constructor (evaluating 'allKeys[i].match(/^[0-9]+$/)') in node_modules/jasmine-core/lib/jasmine-core/jasmine.js (line 2988)
public/assets/src/emailcampaign/email-campaign-preview.spec.js:200:41
I've upgraded all my jasmine and karma related packages. I'm hoping someone here might've seen something similar in the past.
Bug with array equality checking in jasmine 2.5.0 - take a look at the issue in github: https://github.com/jasmine/jasmine/issues/1195
For now, you can revert jasmine to 2.4.1 in your package.json.

Resources