Closed WebFreak001 closed 4 years ago
If this is from an existing project that got upgraded to the latest beta you may need to re-run dub run spasm:bootstrap-webpack
. Recently memory handling has been upgraded and It seems the JS glue code is out-of-sync.
If this is a fresh project, or you did run the bootstrap again, there might be something bigger going on.
Another possibility is that due to a dub run issue it might run an older bootstrap version, thus generating wrong files. When you run the command please make sure dub mentions the correct version of spasm.
this is a fresh project. Because I followed the instructions in the readme it first fetched the non-beta version of spasm and then because it didn't work out of the box (probably forgot the webidl thing) I tried the beta and at that point everything got mixed up, throwing all kinds of errors.
I have now deleted all spasm versions except 0.2.0-beta.7 from my dub folder. Now I did:
dub build --build=release --build-mode=allAtOnce
dub run spasm:webidl -- --bindgen
dub run spasm:bootstrap-webpack
dub run spasm:webidl -- --bindgen
npm install
npm run start
and now it seems to work
Nice.
I wonder if I can get a version identifier in the glue code and check that on build or during run. Multiple people have hit their heads against this and it is far from robust.
I'm trying this simple example code:
but in the browser it first prints
<empty string>
and then crashes withInvalidCharacterError: String contains an invalid character
(in the createElement I guess)Tried LDC 1.20.1 and LDC 1.22.0
I also tried 0.1.13 but there I got the issue
LinkError: import object field 'AbortController_signal_Get' is not a Function
(or others)