Skip to content

LinkError: import object field 'getRoot' is not a Function #31

@WebFreak001

Description

@WebFreak001

tried code

import spasm.spa;

@safe:
nothrow:

struct App
{
	mixin Node!"div";
	@prop innerText = "Hello World!";
}

mixin Spa!App;

in a fresh project. I tried looking around for hints in the readme but didn't really find anything (the README doesn't even tell me to import spasm.spa;)

I then found the function in the spasm/modules/spa.js but had no idea how to even use that and why it's not added. Checked out the spasm/modules/index.js because that looked promising and at the top it told me it's generated with dub run spasm:webpack-bootstrap

I tried running dub run spasm:webpack-bootstrap then and it said that doesn't exist as it is in fact dub run spasm:bootstrap-webpack

Looking for this in the README it says to run dub spasm:webidl -- --bindgen when adding JS bindings.

I tried that and dub complained that it's an invalid command (it should be dub run spasm:webidl -- --bindgen)

Now after it's generated with that file it says the file is generated using that bindgen command and some new "bindings.js" got added but I have no idea where that code even came from and what's the difference from not having it.

Could you maybe add some more information about the index.js file and what the bootstrap-webpack and idl binding generator actually do? Do they parse my D code to determine the libraries or how do they work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions