Angular 11 production fails with error: ERROR TypeError: Object(...) is not a function - angular11

Recently in my company there was an upgrade of angular app version to 11. App locally compiles and runs without a problem with ng serve, however it fails on ng serve --prod with following error:
main.js:1 ERROR TypeError: Object(...) is not a function
at e.value (main.js:1:942704)
at e.value (main.js:1:942493)
at e.value (main.js:1:941765)
at new e (main.js:1:1099073)
at Pr (main.js:1:145982)
at Mr (main.js:1:144712)
at Uo (main.js:1:182147)
at Lo (main.js:1:180936)
at Object.ia [as createRootView] (main.js:1:190182)
at n.value (main.js:1:136423)
bt # main.js:1
TypeError: Object(...) is not a function
at e.value (main.js:1:942704)
at e.value (main.js:1:942493)
at e.value (main.js:1:941765)
at new e (main.js:1:1099073)
at Pr (main.js:1:145982)
at Mr (main.js:1:144712)
at Uo (main.js:1:182147)
at Lo (main.js:1:180936)
at Object.ia [as createRootView] (main.js:1:190182)
at n.value (main.js:1:136423)
I've tried removing rxjs-compat as suggested here. After doing that, production build completely fails, because rxjs-compat is apparently used, even though with Shift + Ctrl + F in Visual Studio nothing is found. I also tried adding rules to tslint.json as suggested here, but that didn't do aything as well. Any suggestions for debugging production code or fixing this issue are welcome.

Related

Error in ng serve command. ./ node module/#angular-devkit/build

node version 14.15.0 and angular version 12.0.5;
earlier it worked fine but after reinstallation of angular and nodejs it shows this error on ng serve command.
ERROR in ./src/assets/styles/style.scss (./node_modules/#angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/dist/cjs.js??ref--15-3!./src/assets/styles/style.scss)
Module Error (from ./node_modules/postcss-loader/src/index.js):
(Emitted value instead of an instance of Error) CssSyntaxError: D:\node-v15.11.0-win-x64\ssc1\src\assets\styles\icons\material-design-iconic-font\css\materialdesignicons.min.css:1:86: Can't resolve '..//fonts/materialdesignicons-webfont.eot' in 'D:\node-v15.11.0-win-x64\ssc1\src\assets\styles\icons\material-design-iconic-font\css'
If anybody know the solution please tell me how to solve this issue
image of error here

How to run Pub-Sub functions in Firebase Functions shell

I'm unable to run my pub-sub triggers in local Cloud Functions Shell. I've created Cloud Functions in the following way:
export const sendNotifications = functions.pubsub.schedule('0 10 * * *').timeZone('Asia/Kolkata').onRun(async (context) => {
console.log('running sendNotificationForActivities');
await sendMessages();
return 0;
}
As mentioned here, I try to run firebase functions:shell from my system followed by:
> sendNotifications({data: new Buffer('{"hello":"world"}'), attributes: {foo: 'bar'}})
or
> sendNotifications({})
and other variants. Following is the error stack trace I received:
firebase > sendNotificationForActivities({})
'Successfully invoked function.'
firebase > ⚠ TypeError: Cannot read property 'params' of undefined
at cloudFunction (/Users/mayurdhurpate/code/pruoo_app/backend_admin/functions/node_modules/firebase-functions/lib/cloud-functions.js:109:38)
at Run (/Users/mayurdhurpate/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:458:20)
at /Users/mayurdhurpate/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:442:19
at Generator.next (<anonymous>)
at /Users/mayurdhurpate/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:7:71
at new Promise (<anonymous>)
at __awaiter (/Users/mayurdhurpate/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:3:12)
at Run (/Users/mayurdhurpate/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:435:12)
at /Users/mayurdhurpate/.npm-global/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:457:15
at Generator.next (<anonymous>)
⚠ Your function was killed because it raised an unhandled error.
I think I might be missing a required params field but I couldn't find the right way to enter the parameters. I'm using firebase-tools#7.1.1 on MacOS.
I have the same error.
The error is located in cloud-functions.js:117:28.
He is trying to access a key of context even if context does not exist.
I updated to the newest version but the error still persists.
As workaround I added this code at line 89 in cloud-functions.js: context = context || {};
This solves the error and I can use the firebase shell.
I hope this nasty hack helps.
Until Google fixes their code or updates the documentation.
Dominik

Getting error while write test case for render in Mocha

I have an Meteor project using BlazeJS. I am writing test case for that project in Mocha for rendering. And i am facing below error:-
Error: No such function: _
at blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3214
at Spacebars.call (spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:172)
at Spacebars.mustacheImpl (spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:106)
at Object.Spacebars.mustache (spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a:110)
at Blaze.View._render (app.js?hash=5f5e88169d987fce5c1c7e49f67c237d33b43cb9:514)
at Blaze.View.doRender (blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2086)
at blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1934
at Function.Template._withTemplateInstanceFunc (blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3744)
at blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1932
at Object.Blaze._withCurrentView (blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2271)
Please advise how I resolved above error.

Error on meteor project setup

I setup meteor environment
meteor create todoapp
cd todoapp
Then write meteor and press enter after then I run on localhost:3000 then I receive following error on terminal
Exception from sub meteor_autoupdate_clientVersions id fRm2pMK35Ji2uPut5
TypeError: Cannot read property 'OneOf' of undefined
I don't know what the actual reason of this issue any way I found a solution I uninstalled Meteor the reinstalled it after this the issue has been resolved.

Exception from sub meteor_autoupdate_clientVersions

I am new to meteor. After creating the default meteor project and running it, I am getting this error:
Exception from sub meteor_autoupdate_clientVersions id 7AsCuXcz8A9yRRNm5
TypeError: Cannot read property '_failIfArgumentsAreNotAllChecked' of undefined
My meteor version is 1.4.3.2
Uninstall meteor and reinstall. Everything will be ok.

Resources