sweetalert2 TypeError: this is undefined after v8 upgrade - sweetalert2

I moved from sweetalert2 ^7.32.4 → ^8.11.7, I read the v8.0.0 breaking changes and none of my code directly call one of the impacted functions.
I wonder what is causing this mysterious error: (TypeError: this is undefined)

As reported in the SweetAlert2 release note for version 8.0.0 referenced at the top of the README, this major version release introduced a breaking change in the way the Swal is invoked. In the release note there is also a link to the reason why this breaking change has been introduced.
The changelog is actually including this breaking change under the title "BREAKING CHANGE: remove withNoNewKeyword enhancer". The content of this commit explains:
From now on the recommended way to use SweetAlert2 is:
Swal.fire({...options})

I went to see the new documentation examples, and they are all launching the popup with Swal.fire() when before Swal() alone was valid.
The problem is that if you check CHANGELOG.md for fire you don't see any mentions of that function. But this is a breaking change as it was earlier not mandatory and now is.
Here is the fix for my specific problem.

Related

NativeScript markingMode: none errors

I'm part of a team that's using NativeScript and angular and we keep getting errors that look like:
Error: com.tns.NativeScriptException: Attempt to use cleared object reference id=<some-object-id-number>
From some research it's because we use markingMode: none in order to speed up our application. We want to keep using this so we need to find the source of the errors. From the documentation, it comes from creating a native object then wrapping it in a JS method so the garbage collector removes the native object in the method but since it's still being referenced an error is thrown. The documentation also indicated that this most likely stems from using plugins that haven't adapted to markingMode: none. The plugin I believe that's causing this is the nstudio nativescript-checkbox plugin. So I looked through the source code to try to find the native options that fit the criteria and my issues are the following:
I'm not sure if I'm finding all the native objects.
I don't know where to release them in the code.
I'm not sure if this plugin is the only one that's causing issues (we use a lot of plugins and all of them are pretty integral to our code).
I scoured our code base and couldn't find any instances where this may be a problem, but I could be wrong.
If anyone has experienced this markingMode: none issue, specifically with plugins, I would love to hear how you dealt with it and if you had any tips/suggestions moving forward. Here's the documentation detailing this issue:
https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/marking-mode-none
The NativeScript developers said it was fixed in this bug fix with an update, but I haven't noticed a change:
https://github.com/NativeScript/NativeScript/issues/7125
UPDATE: I commented out the checkbox plugin and no error, this is definitely being caused by the plugin
Removed all instances of the checkbox component and the side navigation bar and made our own custom components for them.

How to disable "Multiple methods named ... found with mismatched result, parameter type or attributes"

I just started Xcode 6.3 with a project that I have been working on for a while. I did some changes and than ran the previously working program. Result: a build failure with the message
Compile ZXParsedResult.m...
So the ZXing library can suddenly not be compiled any more. I guess this is another XCode bug (the program will not run even after a reset of all changes to the previously working code base). Is it possible to disable this error message?
I already triggered a successful clean on the project.
Looks like problem has been solved in latest version of library, see discussion on this issue https://github.com/TheLevelUp/ZXingObjC/issues/208
If you are not ready to upgrade to latest version, I'd prefer this fix from discussion
(id)parsedResultWithType:(ZXParsedResultType)type {
return [(ZXParsedResult *)[self alloc] initWithType:type];
}
More on such kind of errors
new in Xcode 6.3/iOS 8.3: using self alloc for convenience constructor causes build error

Upgrading custom iOS plugins from Cordoba 1.7 to 2.1, how can I find out why they are never loaded?

I've got my plugins converted, or so I think, and registered in Cordova.plist. The method signatures are correct, according to this guide. Nothing has changed on the js side, yet they don't load and just fail silently. Cordova itself is working, onDeviceReady is firing, but my plugins just never get executed. Everything worked fine with 1.7...
I'd like some help to get started on figuring out where they are supposed to be loaded and/or called from js on the obj-c side. Where can I set a breakpoint in the Cordova source to see why it's not executing my plugin?
Where should I begin to look?
I just did exactly this migration. All I can say is that it worked for me if you follow the steps. You also need to follow the steps from the 1.9>2.0 migration.
Since Cordova 2.0, the framework had big changes.
Maybe is better you implements again using the 2.0 rules and, after, only override selector signature. Thus you learn how do plugin in new versions, updating your Cordova skills. :)
Single big change between 2.0 and 2.1 (for plugins)
Support a new plugin method signature (old signature is deprecated):
The new signature is:
- (void) myMethod:(CDVInvokedUrlCommand*)command;
The old (deprecated) signature is:
- (void) myMethod:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;

Add-on support after update

In a previous project I wrote a Firefox extensions - nothing too complex - that used xmpp4moz, an add-on for Firefox that integrates the xmpp/Jabber protocol. At that time Firefox 3.6 most the most recent one and everything worked quite well. Now with Firefox 5 xmpp4moz does produces errors, starting with
Error: Component.classes['#something/something/...'] is undefined
and naturally resulting in further 'undefined' errors. In some sense this is ok, since xmpp4moz is officially not available for Firefox 5. And given that the last update was in 2009 I don't really expect a updated version. Currently I see the following two options:
Looking for alternatives/workarounds/...; so far I haven't found anything. Any ideas?
Trying to update/modify xmpp4moz myself to make it running in Firefox 5
The thing is that at the moment I cannot really assess the required efforts.
Summing up, I'm stuck :)
The sameplace download at http://www.sameplace.cc/ appears to include a slightly newer version of xmpp4moz (I didn't really check whether install.rdf is the only difference from the source code repository however). Still, it is only compatible with Firefox 3.6. From the look of it, there are no big issues, main problem is that the XPCOM components aren't being registered. See https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0 for information on the relevant changes, usually updating the components and chrome.manifest is easy.

Warnings in Flex Builder

in my current project i use three swc-Files (mate.swc, SQLExtensions and Thunderbolt).
Unfortunately, in the problems view, i receive for each file the following warning: Design mode could not load Mate_08_9.swc. It may be incompatible with this SDK, or invalid.
I don't want supress all warnings in general. But it will very helpful to supress these warnings, specialy i receive it for all files in my project three times.
Do you have a idea, if its possible?
Thank you
Frank
I remember seeing this somewhere, it's either a Flash Builder or a SDK issue. I think you need to update to the 4.1 version of both products

Resources