Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'pathname') React router dom v6 [duplicate] - react-router

This question already has an answer here:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'pathname') react-router V6
(1 answer)
Closed 10 months ago.
i'm trying to use the navigate function to jump from this url "/personnel/login" to a url of this kind "/personnel/:id/acquisition" and i get the error message mentioned in the title. Anybody had the same issue before?

Related

Version conflict - Uncaught DOMException, the name "mwc-icon" has already been used with this registry. Custom Component

I'm trying to use Material Custom Component and also using some other components. But I have version conflict Uncaught DOMException.
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "mwc-icon" has already been used with this registry.
Currently, I'm using the yarn package manager to handle custom-component versions.
Somewhere in your code, you're trying to register the same custom element more than once. Maybe you're importing a library twice?

Cannot access 'functionName' before initialization when using arrow syntax [duplicate]

This question already has answers here:
Are 'Arrow Functions' and 'Functions' equivalent / interchangeable?
(4 answers)
var functionName = function() {} vs function functionName() {}
(41 answers)
Closed 2 years ago.
I had a javaScript function with many nested functions. First I declared all my functions like function funcName() {...js code} and everything was fine.
Then I've created a React app that uses ES6 syntax, such as arrow functions.
Now I'm trying to import my well tested javaScript function to the React app. I changed all that nested functions to arrow functions with the same content to keep using ES6 syntax.
Now when any of that functions is called, I get an error: 'Cannot access 'circlesByPath' before initialization'.
This one is for circlesByPath func, when I change it back to normal function syntax, I don't get this error.
Can anyone answer why is this happening? I previously considered arrow functions to be only a modern way to declare function, I didn't use arrow functions in vanilla javascript, only in my React app. Now I see something is wrong with them...
I returned function keyword to every function.
Now The problem is "ReferenceError: holesNum is not defined"
It happens every time when script uses variable that was meant to be global (declared with no 'var', 'let' or 'const' keywords), it worked before (without React), now all variables are undefined...

Google map Loading Error -> Uncaught TypeError: Cannot read property 'ga' of undefined at common.js:143

Getting the error
Uncaught TypeError: Cannot read property 'ga' of undefined at common.js:143 while loading google maps since today.
Using Version: 3.27
Api call - https://maps.googleapis.com/maps/api/js?client=CLIENT_ID&v=3.27&libraries=geometry,places,drawing&callback=gMapsCallback
The map had been working fine,no other changes were made in the code. Debugging a bit could see a reference of "this" value getting changed in the common.js function of the google maps for some tile load calls.
Any help would be appreciated. Thanks.
As the frozen version is now 3.29, It is plausible to assume that a new version came into force and, as a result the version you are now running (3.27) throws an error. See all the relative info here
You just have to request the frozen version with the following bootstrap:
<script async defer
src="https://maps.googleapis.com/maps/api/js?v=3.29
&key=YOUR_API_KEY&callback=initMap">

Ionic App throwing "Cannot read property 'id' of null at PinchRecognizer.recognizeWith" loading Forge Viewer

I am working on an app written in TypeScript using the Ionic Framework. I'm attempting to load the first model into the forge viewer and I receive the below error when I attempt to call the viewer start method:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'id' of null
TypeError: Cannot read property 'id' of null
at PinchRecognizer.recognizeWith (viewer3D.js?v=4.0:2326)
at Array.forEach (<anonymous>)
at each (viewer3D.js?v=4.0:945)
at invokeArrayArg (viewer3D.js?v=4.0:925)
at PinchRecognizer.recognizeWith (viewer3D.js?v=4.0:2320)
at new Autodesk.Viewing.GestureHandler (viewer3D.js?v=4.0:13760)
at GuiViewer3D.Viewer3D.createControls (viewer3D.js?v=4.0:44610)
at GuiViewer3D.Viewer3D.initialize (viewer3D.js?v=4.0:44694)
at GuiViewer3D.initialize (viewer3D.js?v=4.0:50771)
at GuiViewer3D.Viewer3D.start (viewer3D.js?v=4.0:44438)
at PinchRecognizer.recognizeWith (viewer3D.js?v=4.0:2326)
at Array.forEach (<anonymous>)
at each (viewer3D.js?v=4.0:945)
at invokeArrayArg (viewer3D.js?v=4.0:925)
at PinchRecognizer.recognizeWith (viewer3D.js?v=4.0:2320)
at new Autodesk.Viewing.GestureHandler (viewer3D.js?v=4.0:13760)
at GuiViewer3D.Viewer3D.createControls (viewer3D.js?v=4.0:44610)
at GuiViewer3D.Viewer3D.initialize (viewer3D.js?v=4.0:44694)
at GuiViewer3D.initialize (viewer3D.js?v=4.0:50771)
at GuiViewer3D.Viewer3D.start (viewer3D.js?v=4.0:44438)
at c (polyfills.js:3)
at c (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (core.js:4620)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
at o (polyfills.js:3)
at e.invokeTask [as invoke] (polyfills.js:3)
at p (polyfills.js:2)
I read another stack overflow with the same issue, where there were competing libraries but I do not think that is the case for me. (Unless Ionic is utilizing something.)
Any ideas on what could be missing?
Here is the feedback I received a while ago from a developer having the same exception than you on Cordova:
I managed to find the cause of the console error. In hammer.js (which
is included in the viewer3D.js file), there is a method on the
‘Manager’ object called ‘get(Recognizer)’ which contains a check
whether the provided parameter object is of type ‘Recognizer’. This
check somehow fails, causing the method to return null. This will
break the gesture handler later on in the call stack. I managed to fix
it in my environment by changing the check to check the object for
type ‘Object’ rather than ‘Recognizer’. This seems to fix my issue,
and does not seem to break other functionality. I couldn’t find
anything unusual on the Forge side that could have caused this issue
though, so it could be a generic problem.
Unfortunately I think you will have to use a custom modified version of the viewer3D.js source and patch the source yourself.

unsatisfied link error on android when using STL in natives (NDK) while using standalone toolchain

I am getting unsatisfied link error when I'm trying to launch my C++ based app on Android. The problem only appear if I use any of STL mechanism, when I comment out all std::vector etc. the problem disappears.
EDIT: I found out that this is about all C++, not only STL (ie. new operator also cause unsatisfied link error)
I am using custom, standalone toolchain to build binary (targeting android 1.6), and link it with libstdc++.a, libGLESv1_CM.a, liblog.a and libm.a.
In Java I call:
static {
System.loadLibrary("GLESv1_CM");
System.loadLibrary("Game");
}
The exact build order is:
engine_sources -> libengine.a
game_sources + libengine.a + all mentioned libraries (using --whole-archive for each) -> libGame.so
Java_framework + libGame.so -> Game.apk
Is there something I'm missing?
Edit2:
As suggested in http://mpigulski.blogspot.com/2010/09/debugging-dlopen-unsatisfiedlinkerror.html I run arm-linux-androideabi-ld.exe libGame.so and got this:
arm-linux-androideabi-ld.exe: warning: cannot find entry symbol _start; defaulting to 00008270
libGame.so: undefined reference to `__aeabi_fadd'
libGame.so: undefined reference to `__aeabi_fcmpgt'
libGame.so: undefined reference to `__aeabi_i2f'
libGame.so: undefined reference to `__aeabi_dmul'
libGame.so: undefined reference to `__aeabi_d2f'
libGame.so: undefined reference to `vtable for OpenGLRenderer'
libGame.so: undefined reference to `__aeabi_fsub'
libGame.so: undefined reference to `__aeabi_idiv'
libGame.so: undefined reference to `__aeabi_fdiv'
libGame.so: undefined reference to `__aeabi_uidiv'
libGame.so: undefined reference to `__aeabi_fcmpeq'
libGame.so: undefined reference to `__aeabi_fmul'
libGame.so: undefined reference to `__aeabi_fcmplt'
libGame.so: undefined reference to `__aeabi_f2d'
I am especially concerned about
libGame.so: undefined reference to `vtable for OpenGLRenderer'
OpenGLRenderer is a child of abstract class which I am creating with new. Am I missing something here?
In case people are looking for libsupc++.a, you can find it under:
./sources/cxx-stl/gnu-libstdc++/libs/
This is also where you will find libgnustl_shared.so
(sorry, can't add comments to the previous answer, not enough rep)
You possibly missed libsupc++.a. It is required for rtti and exceptions. You should explicitly disable rtti and exceptions (-fno-rtti -fno-exceptions) or link against this library.