Typescript & componentsjs-generator setup help #56
-
Hi there! I'm having some problems setting up a typescript project that uses My project: https://github.com/ixuz/componentsjs-ts-start I'm running into this error when starting
Additionally, see: Any advice/help would be much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
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 In order to register your config, the commented-out line is in fact what you'll need: await componentsManager.configRegistry.register("config/config.jsonld"); |
Beta Was this translation helpful? Give feedback.
Your overall setup looks correct to me, except for one thing:
I suspect the problem lies here:
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.