Using "UNSAFE_componentWillMount" in strict mode. But I'm not sure where the issue is - next.js

I have a Next.js application that when run, gives me this issue on the browsers console.
Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
* Move code with side effects to componentDidMount, and set initial state in the constructor.
Please update the following components: SideEffect(NullComponent)
I am not sure what SideEffect(NullComponent) is and searching through all the text in my project returns no result. So I'm not sure where the problem is coming from in order to try and resolve it, or be able to provide some relevant code in here.
What does this error mean, and how can I locate at least what file is causing the issue?

The error that you see is most likely the be in a package that you are using
Try to search for the whole project (including node_modules folder) or look more carefully in the console error (name of the file that generates the error).
This way you will know which package uses the outdated code and decide to keep it or update it or use another similar package.
To search for the whole project including node_modules

Related

Error when calling createDefaultLayers() in HERE API

EDIT: Is there anywhere to get an un-minified version of the Here-api to use when debugging? It's impossible for me to figure out what 'v' is and why it may be undefined.
We're using the HERE API both from our website where it works flawlessly and our old RDP C++ application which runs a similar webpage in an embedded IE window. It should be using a stripped version of IE11 I believe.
We recently upgraded to the new HERE API after routing stopped working in the old one, and it worked for a while but a while ago it suddenly didn't. And no one can recall making any changes that could affect this.
I have narrowed it down to a single line of code where it crashes. (platform is already defined in the scope through our geo-service script, the same one being used for the web that works)
var defaultLayers = platform.createDefaultLayers();
This is an initialization of the map layers that is required for the maps to work, but we simply can't perform this action through this embedded browser window even though we run almost identical code on the web.
We receive two error messages of:
'v' is undefined
With a reference to some dynamically generated eval code.
This is the only lead I've managed to dig up, it's not much but I'm hoping someone else has encountered a similar issue and can point me in the right direction what to look for.
I found the issue, it was totally self inflicted...
When we implemented the solution there was an issue in the core js file from Here which made it not work in our servers due to some path being wrong. To fix this we had changed the path so it worked and then hosted our own version of the core file.
This worked great, until Here put up a new minor release which is automatically distributed through the same content link as before. This meant the minified files were no longer in sync with the variable names, thus causing v to never be defined where it should, since in our file it was probably named something else.
It was only by chance I noticed that the core js was side-loaded like that, I was looking in the completely opposite direction the entire time and didn't even consider the loading might've been tinkered with.

Meteor Testing Using Spies

I'm using Velocity with the mike:mocha framework and the chai assertions. Everything is working great, but when it comes time to do stubbing, mocking and spying, I've hit a bit of a roadblock. These aren't core features of mike:mocha or chai, so I found practicalmeteor:chai, which should/may have added spies.
My first stab at finding out whether this is true was to write the following code:
it 'calls update when both documents are present but different', ->
spies.create('log', console, 'log')
which gives me:
ReferenceError: spies is not defined
at packages/velocity:test-proxy/tests/mocha/server/charger_server_doc_spec.coffee:88:9
at wrappedFunc (packages/mike:mocha/server.js:200:1)
at runWithEnvironment (packages/mike:mocha/server.js:156:1)
That implies to me that I've misunderstood what practicalmeteor:chai provides, however, the code I showed in the first example is copied verbatim from the README.
Question: Any tips on getting this to work? Is it a load order issue? The code on Github shows spies and so on are implemented in this package. So I'm a bit stuck.
Thanks!
The package practicalmeteor:chai does not include the practicalmeteor:sinon package which is required to get the spies API included.
They are separate packages because you may not have to use spies when creating basic tests with chai.
If you look at the package.js file in the practicalmeteor:chai package, it does not include the sinon files.
So, just running meteor add practicalmeteor:sinon should solve your problem.

Packages not defined

i wrote a script in javascript and used it in rules (share). The script start with:
var ctx = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
I m getting an error telling me that "Reference error: Packages is not defined".
How can i solve this issue?
The Packages object is only available for code which is considered "secure". This is most likely failing because the code is from a node in the Repository/Data-Dictionary. Put it somewhere in the classpath (e.g. classes/alfresco/templates/webscripts/...).
I don't think you can use this object in javascript, you won't find that code anywhere in Share javascript files. According to this link, Package root scope object is only available for web script implementations placed into the Java classpath, due to security reasons.
Try writing Java code for your rule.

Runtime error but project compiles fine - Imports/using missing

I am very confused right now. I have VS2008 at my job right now and I have a weird behavior that I have been searching for a while now.
When I compile the project, it works fine, but in runtime I have an error saying object not defined or something like that. The problem is that the imports/using is missing in my class but why does it compile?
In fact, I want to be able to see that error when compiling not when running the webapp.
REEDITED: Here is an example. Lets say i want to use a typed list, I am declaring my object list(of int) for example without having added my imports (system.collection.generic) in the class. then I compile, it works and then I run it, it fails because of the imports missing. is this normal behavior or not?
REREEDITED: I just noticed that the DLL of all my references were not copied in my bin folders even though all of them are set to "Copy local = true". Is it possible that it has to do with our shared directory (all external dlls) being on a network drive (\server\shared). I am really out of ideas on this issue....
problem was because we were having the classes in the app_data folder
The answer to the current question - why you are getting this error - is that ASP.NET does not show many errors at compile-time. You will need to manually go through the application to verify that all pages work correctly. This is very common with ASP.NET development, due to the nature of the environment.
If you post the real errors (probably should be as another SO question), we can perhaps help you with them.
Remove all the dll, etc from bin...
rebuild the whole solution then run
It should run fine...

Selenium-Flex API sample problem

I'm trying the sample demo of selenium flex API. After following the instructions on the main page for compiling the project with sfpi.swc and taking the generated selben.swf in bin directory and trying to run some test(assertFlexText) using Selenium IDE, I get the following error:
[error] Function getFlexText not found on the External Interface for
the flash object selben
I have tried several other flex tests and got error messages similar to the one mentioned above.
For some reason I believe that the generated selben.swf through the automatic build of project in flex builder is not the desired one, though it didn't indicate any build problem after including sfpi.swc.
Any idea?
I use SeleniumFlex Api and SeleniumIde for my projecy with excellent result BUT using my own version of each of one. Your error maybe is for not include the lib of SeleniumFlexApi in the compile time( -include-libraries "libs\SeleniumFlexAPI.swc" ).
After that u can enable capture and replay with SeleniumIde change the main source (read this post) and use the user-extensions.js (in the SeleniumFlexApi project) with the SeleniumIde user option. Its really easy.
With these change u can capture and replay in firefox (v 3.06 or minor) and after that, if u use java, u can use Flex-UI-Selenium, Flash-Selenium for ur integration test with SeleniumRC.
I hope this information be usefull. I u have any question let me know.

Resources