Skip to content

Typescript & componentsjs-generator setup help #56

Answered by rubensworks
ixuz asked this question in Q&A
Discussion options

You must be logged in to vote

Your overall setup looks correct to me, except for one thing:

I suspect the problem lies here:

    const componentsManager = await ComponentsManager.build({
      mainModulePath: __dirname, // Path to your npm package's root
      moduleLoader: (registry) =>
        registry.registerModule("config/config.jsonld"),
    });

You are overriding the default moduleLoader (the thing that loads the instantiatable components into a registry), and are registering your config as a module (while this isn't a module, but a config).
You can probably just keep the default moduleLoader (not override it), as this will load all possible modules it can find, so that you can refer to them from your config file.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ixuz
Comment options

@rubensworks
Comment options

@ixuz
Comment options

@rubensworks
Comment options

Answer selected by rubensworks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants