pns_confirmRegex of undefined - reactjs

I'm running a deployment to heroku, I'm unable to produce this locally, but I'm getting this error:
Uncaught TypeError: Cannot read property 'pns_confirmRegex' of undefined
at Object.i [as check] (h1.js:150)
at HTMLDocument.<anonymous> (h1.js:62)
at l (h1.js:48)
at c (h1.js:48)
Like I know there's an undefined item somewhere... and if you look at the sources, it's coming from something of h1.js .
I'm using react with some service workers in the front-end and they are all transpiled together with webpack. Does anyone have any idea what this might be?

Check the stack trace very carefully and you should see that this probably has to do with https://github.com/facebook/react-devtools/issues/461.
I had the same error and uninstalled Honey. If you click on the links in the stack trace you should be able to look at the code and see a bunch of Regex selectors that Honey seems to employ.

Disable Honey Chrome extension and cures the issue. Thank you Yehuda M. Makarov

Related

AWS-sdk contributes to Build Error "Uncaught TypeError: e is not a constructor"

My react application is working fine until I wanted to wrap it up and deploy it. The build via vite build is successful. However, when the built folder "dist" is deployed and served, it says Uncaught TypeError: e is not a constructor.
After hours of debug, I can confirm that it's the aws-sdk that is causing the issue. In particular, the following code:
const s3 = new S3({
accessKeyId: VITE_ACCESS_KEY_ID,
secretAccessKey: VITE_SECRET_ACCESS_KEY,
region: VITE_REGION,
});
I think the new S3(...config) here corresponds to a line that reads o = new e; in the compiled index.bad38efb.js file that gives the Uncaught TypeError: e is not a constructor error.
Ultimately the question comes down to, is there any alternative that I could authenticate with s3 or does anyone know how to resolve this problem? Please let me know what extra information could I provide to answer the question.
Had the same issue, although harder to debug since I was not getting any errors in building.
Solution is to move to the v3 version of the SDK which is better maintained (and has other benefits too).

'Uncaught TypeError: angular.module(...).run(...) is not a function' in Grunt minified js-file

My code works on development mode, uncompressed. But when I use grunt's minify functionality and run the app in production mode, I get that error: Uncaught TypeError: angular.module(...).run(...) is not a function.
When I look into the error in Google Chrome Developer Tools, I get what you see in the screenshot. Does anybody understand where the problem is?
I am using Angular 1.4+ in Angular-Fullstack. The error occurs in vendor.{{randomstring}}.js.
Thanks for any support!
You have 2 issues here.
Dependency injection. You can edit manually the archives or use https://github.com/mgol/grunt-ng-annotate this will do this automagically for you.
Concatenation. Check this grunt plugin https://github.com/gruntjs/grunt-contrib-concat the issue here is javascript dont understand when a function end/start because dont have a separation mark, check where the error is.
})(function(a,b) {
It should be:
});(function(a,b) {
Check the "Concatenating with a custom separator" example of grunt-contrib-concat

camerapreview plugin is not found by my angular js app

So I have yet another problem with my home application. I am trying to get a live preview image directly on my html page. I am using VS Community and I linked to https://github.com/mbppower/CordovaCameraPreview.git to download the right repository. VS then tells me I have downloaded it. However, when I try to plug the line:
cordova.plugins.camerapreview.startCamera(rect, "front", tapEnabled, dragEnabled, toBack)
I get back an error in my javascript which reads as follows:
Cannot read property 'camerapreview' of undefined
I am following the orders of the github post to the letter but I am still getting an error. Any help in solving this problem will be greatly appreciated!
The error message
Cannot read property 'camerapreview' of undefined
tells you that in this statement:
cordova.plugins.camerapreview.startCamera(rect, ...
cordova.plugins is not defined - that's where you need to look.

Rollbar got javascript error that's not related to the code

Not sure if somebody ever experiencing this.
I use Rollbar for collecting error from front-end React project.
But i got some strange error like...
132 TypeError: undefined is not an object (evaluating 'document.getElementsByName('emailconfirm_1')[0].value = ''')
the strange part is that, i don't have any of emailconfirm object in my code at all.
i grep this name to my whole project directory, including built assets, but can't find any...
Can somebody think of the possibility that could make this happen? it's just looks so weird to me.

Getting useful errors from Typescript/Angular2

I am working through the Angular2 TypeScript Heroes tutorial. At some point we actively create an error. Basically the tutorial asks to write some html that calls an undefined variable. It indicates that my console should show:
EXCEPTION: TypeError: Cannot read property 'name' of undefined in [null]
However what I get in Safari and Chromium is about 500 lines of stack dumps (This is one page load and it triggered 17 errors!)
I have run through the tutorial from install exactly so my setup should be correct. How can I get a cleaner error? I can infer the issue for sure but I'd rather not have 500 lines of errors for every typo I do. Could end up crashing my browser :)
I am new to TS so perhaps there is a setting I need to adjust some debug setting?

Resources