Webstorm - errors after pub:build - dart

I wrote simple example code in the WebStorm EAP
void main() {
var main = new Element.html('<div class="main"></div>');
document.body.children.add(main);
}
in Dartium - all is well, after pub:debug - - all is well,
but after pub:build project, in realise/index.html I do not see anything, only an error in the console:
"main.dart.js:1159 Uncaught TypeError: Cannot read property 'at' of null"
Please explain to me what is the problem, and how can I get the correct build files.

Related

Uncaught lua exception error in zerobrane, any solution?

Zerobrane version v1.90
This error is caused after I put the following code into user preference:
styles.indicator.fncall = {fg = {-110,0,0}} --I got this in documentation page of zerobrane
I tried to reinstall zerobrane(both portable version and .exe verison) but the problem is still here.
Screenshot of the error message:
{-110,0,0}
You're passing a negative value as the red value; there's no way that could work (What would it even do?)

Syntax error in library code when including matrial design using Rails + Webpacker + Typescript + Angular

In my rails app, I get a syntax error somewhere in a huge js file that is presumably generated by webpacker. But it seems to be some sort of angular/material code. If I don't include material design, the error goes away, so it seems to be related to material design. This is the part that causes the syntax error:
function instantiateSupportedAnimationDriver() {
return !(function webpackMissingModule() { var e = new Error("Cannot find module '#angular/animations/browser'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())() ? new !(function webpackMissingModule() { var e = new Error("Cannot find module '#angular/animations/browser'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())() : new !(function webpackMissingModule() { var e = new Error("Cannot find module '#angular/animations/browser'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())();
}
Note that telling me how to fix the syntax error doesn't help me. This code is not in my control and I wouldn't know how to effectively patch it. Besides, it's a frequently used piece of code, I doubt that it has a syntax error, probably something in plumbing is incorrect.
Some context: I probably don't get all the mechanics right. I am trying to make the combination Rails + Webpacker + Typescript + Angular + Material work. It's quite tricky, I find nothing useful on it on the web and I seem to be pretty much the first one to do it. I saw some suggestions to make an api-only rails app, but I don't like that...
I never really figured out why this caused a syntax error in a seemingly unrelated file, but I had some "unmet peer dependency" warnings and when I fixed them, this went away.

DirectX: can't render a model from CMO

I'm trying to draw a model using DirectX (following this tutorial: https://github.com/Microsoft/DirectXTK/wiki/Rendering-a-model?fbclid=IwAR3A0mw9rzjJHrN3mwgSb9a6oKqNgiDiAnnfkVLIIQVca9Og6cvfvscuVfE).
I've add my model.cmo file with Add existing item and following line to Game::CreateDevice()
m_model = Model::CreateFromCMO(m_d3dDevice.Get(), L"model.cmo", *m_fxFactory);
I can't build and run my project because of exception on aboved line
Unhandled exception at 0x747318A2 in directX_project.exe: Microsoft C++ exception: std::exception at memory location 0x00B3F738. occurred
I will appreciate any tips on how to resolve or debug that issue
You should enable "break on C++ exception" for the debugger as indicated in the instructions here for std::exception so you can see exactly what code triggered the exception.
Note that more recent versions of the DirectX Tool Kit provide more debug output for those kinds of failures which are probably 'file not found' or similar issue.
The DirectX Tool Kit also implements the what method for it's C++ exceptions, so you can use this code to get more detail:
try
{
m_model = Model::CreateFromCMO(m_d3dDevice.Get(), L"model.cmo", *m_fxFactory);
}
catch (std::exception& ex)
{
std::cout << ex.what();
// Do some error handling here or call throw to re-throw it
}

Running a simple Dart test in WebStorm 10.0.4 [duplicate]

This question already has an answer here:
WebStorm DartUnit with test api, run/debug error
(1 answer)
Closed 7 years ago.
This should be trivial but it is not working as I think it should. I am new to WebStorm.
I have a simple test taken from Dart's new test offering at https://pub.dartlang.org/packages/test
.dart
import "package:test/test.dart";
void main() {
test("String.split() splits the string on the delimiter", () {
var string = "foo,bar,baz";
expect(string.split(","), equals(["foo", "bar", "baz"]));
});
test("String.trim() removes surrounding whitespace", () {
var string = " foo ";
expect(string.trim(), equals("foo"));
});
}
Running this simple test gives the following exception:
J:\dart\dart-sdk\bin\dart.exe --ignore-unrecognized-flags --checked --package-root=J:\workspace\epimss\dart\epimss_shared\packages --enable-vm-service:60110 --trace_service_pause_events C:\Users\st.clair.clarke\AppData\Local\Temp\jetbrains_unit_config.dart
Testing started at 3:07 AM ...
Observatory listening on http://127.0.0.1:60110
Unhandled exception:
No top-level setter 'unittestConfiguration=' declared.
NoSuchMethodError: method not found: 'unittestConfiguration='
Receiver: top-level
Arguments: [Instance of 'JetBrainsUnitConfig']
#0 NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:188)
#1 main (file:///x:/Users/zang/AppData/Local/Temp/jetbrains_unit_config.dart:10:3)
#2 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:259)
#3 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)
Process finished with exit code 255
The problem seems to be the line unittestConfiguration = config; in the jetbrains configuration - something is expected for the config.
Any help is appreciated.
According to this issue, test package is not yet supported by WebStorm's testing framework.
You have two ways right now:
Run it as usual dart application, not as a test
Use deprecated unittest package instead of test until issue is resolved.

Error invoking clientX with Dart2JS

When compiling code with dart dart2js, and run in chrome or firefox
void main() {
window.onMouseDown.listen((e) => print(e.clientX));
}
Result:
Uncaught TypeError: undefined is not a function
In Dartium there is no error.
e.client.x should work.
e.clientX was available for a long time but deprecated. Maybe it was removed recently.

Resources