Dart code not working after compiled to JS - dart

So.. there's something weird happening to me.
My code in Dartium was working perfectly until I compiled it o JS. Now only the JS version of it works.. If I compile to JS then I run the program it works. But the Dart Code by itself no long works anymore :(
Does anyone had encountered a similar problem? IS it normal?
If necessary I can paste the entire program here.. but the problem is that Dart is not throwing me any errors and my compiled code works, so I don't know where to look at :(
Thanks!

There were some (maybe) similar problems mentioned lately which were solved by updating to a new Dart version.
If it's not that it's even weirder.

Related

F# build error: "No compiled representation for provided namespace"

Has anyone run into this error message before? Google found it for me in the source code (https://github.com/fsharp/fsharp/blob/master/src/fsharp/tast.fs), but I haven't the slightest idea what is causing it.
This started happening when I tried to upgrade my library project from .NET 5 to .NET 6, so the real answer to my question may be an explanation of what I did wrong there. All I did was the following:
In the fsproj, changed "TargetFramework" from "net5.0" to "net6.0"
In my paket.dependencies file, changed "framework" from "net5.0" to "net6.0". (I've also tried commenting out the "framework" line.)
Then after running "paket update" and "dotnet build" I get the obscure error. ("error FS0192 : internal error : No compiled representation for provided namespace")
UPDATE: After some laborious code commenting/uncommenting, etc., I believe I've narrowed this down to my code's use of the Fable.RegexProvider assembly. (I use the SafeRegex component.) RegexProvider hasn't been updated in a couple years. I'll alert the folks over there to this issue, and I'll post an update here if/when I learn anything. (In case anybody else runs into this.)
In case anyone else runs into this, here is the solution (which is the solution #CaringDev recommended above, though it only works for Fable 3.7.18 and after):
When I raised this issue on the Fable.RegexProvider github (see thread here: https://github.com/fable-compiler/Fable.RegexProvider/issues/9), the initial thought was to try a .NET 6 build of Fable.RegexProvider. But then Alfonso Garcia-Caro realized that subsequent improvements to Fable may have obviated the need for SafeRegex.
He ultimately needed to tweak something in Fable, but as of version 3.7.18, the Fable transpiler supports the use of FSharp.Text.RegexProvider, such that Fable.RegexProvider is now unnecessary.

Angular dart on WebStorm. Debug is no more working

It is a week now that I have problems debugging angular dart applications in WebStorm. If I use debug on a console (server) application everything works fine.
I tried to roll back to angular 4.0.0 (on dart 1.24.3), but this didn't help.
I really don't know what kind of info could be useful.
Please, let me know if there is some configuration file that I can print or that could be important in order to fix the problem. I tested a lot of configurations, but, at present, I'm not able to work properly. After filling up my code with print statements, there are some cases where also this practice is not enough.
Edit1:
I have tried to create a sample project. With no DDc and target chrome, the debugger stops but not on all breakpoints. With no DDc and target Dartium, it does not stop.
Edit 2:
I was running my application with target dartium, because with target chrome I had an annoying error that I was not able to catch. Now I got it, and running the project with target chrome, revives the debugger. This is a good new. Just a question, is a problem of release 1.24.3 (Dartium has not been released for this release) or something else? Anyway, if this is a known problem, it wouldn't be better to disable the target dartium on WebStorm when the release is 1.24.3?
Edit 3:
Now the debugger is working, but only on the project you are developing. The imported packages are not stopping on breakpoints. As my project is divided in a lot of packages, I cannot debug approximately 80% of my code.
Am I doing something wrong?
What you are hitting here isn't functionality directly in an Angular Dart or Dart issue, but in the JS Debugger in WebStorm.
Open an issue on YouTrack here: https://youtrack.jetbrains.com/issues
Include not only the version of Angular and the Dart SDK, but also the version of WebStorm, and an example of where breakpoints are not working.
Finally, there is some information in this issue that might help: https://youtrack.jetbrains.com/issue/WEB-30593

Xcode code autocompletion strange behaviour in function

Code completion suddenly stopped working in my viewDidLoad function. However, strangely, autocomplete works properly in other functions. It turns out that autocomplete does not work after a lot of code in a particular function. The viewDidLoad function has around 100 lines of code. And autocomplete becomes extremely slow after this. Autocomplete works properly in other projects.
P.S- The following did not work- Deleting Derived Data, commands in terminal etc. I had installed FuzzyAutocomplete through the Alcatraz plug in, but I deleted Alcatraz soon after. I think the fuzzy autocomplete plug in has still not been uninstalled even though I deleted alcatraz by pasting this into terminal-
rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin
I think there is some bug, and fuzzy autocomplete has blocked the Xcode code completion. All of this did not help. What can I do? Please help.
So well, I finally figured this out. I reinstalled Xcode on my laptop, and the problem didn't seem to go away. So I got to know that there was something wrong with my code. Xcode might have probably got stuck while processing that bit of code. So I slowly kept on commenting out one line after the other while checking whether code completion had started to work. I narrowed this down to one code block in my viewDidLoad() function which involved quite a lot of calculation. When I narrowed it down to just this much, Xcode suddenly gave me an error- Expression was too complex to be solved in reasonable time. Consider breaking up the expression in distinct sub-expressions. That line involved a long calculation of addition and subtraction which made Xcode get stuck on it which is why code completion could not find enough memory to run smoothly in that particular function, and Xcode kept on indexing again and again. For some reason, the previously installed copy of Xcode did not give me this error. Thankfully, this copy did. So the problem was sorted.
P.S- I was using Xcode 7.1 which was the latest version.

JNWSpringAnimation Framework for iOS (Compile Errors)

I followed the instructions that came with the framework at the github repository. But I got an error when I tried to compile all stemming from the NSValue+JNWAdditions files. The example project that comes with the code is meant to run in Mac OS X and not iOS. What am I missing here when trying to use this framework for an iOS app? For giggles I removed the aforementioned files and was able to compile but got a runtime error, I guess not surprising. I'm fairly new to this stuff and just want to play with animation and springs :(
GitHub repository:
https://github.com/jwilling/JNWSpringAnimation
Help!
Ah. Got it. For any fellow newbs out there: I had to import UIKit into the header file of NSValue+JNWAdditions.h. This got rid of all the "Expected a type" errors! Makes sense to me now and I have no idea why this took me so long to figure out.
Womp womp

Dart Polymer white screen of death?

I have a project that works fine when I view as Javascript but when I boot it in Dartium nothing is shown. There is no errors either. I am not sure what I have done. Even other projects that haven't had their code touched for weeks no longer can be view in Dartium so I assume it's a dodgy package but pubspec only uses browser, polymer, tweenengine.
Thoughts?
I also had that problem yesterday. Deleting Dart Editor + Dartium and installing it again, fixed it for me. A Friend also had that problem, reinstalling also fixed it for him.

Resources