Closed angelaraya closed 1 year ago
Thanks for reporting!
Are you sure that you've re-executed the build:components
script?
Could you share the generated components/components.jsonld
and components/context.jsonld
files?
Yes, I've rebuilt the project several times, this is just from a fresh build:
dist/components/components.jsonld and dist/components/context.jsonld
I don't see any problems with this at first glance. Your host
parameter is available in both of those files, so they should be recognised when using them in the config file using the proper context import.
Have you been able to use Components.js successfully in the past in this project? Or is it just this class that causes problems?
Yes, the problem surfaced with this class. In the main branch of the repo a working config has been there for a while.
On Thu, Feb 2, 2023, 02:59 Ruben Taelman @.***> wrote:
I don't see any problems with this at first glance. Your host parameter is available in both of those files, so they should be recognised when using them in the config file using the proper context import.
Have you been able to use Components.js successfully in the past in this project? Or is it just this class that causes problems?
— Reply to this email directly, view it on GitHub https://github.com/LinkedSoftwareDependencies/Components.js/issues/114#issuecomment-1413366615, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANV7ZWQQRHDJAZT57KBGAVTWVNZPTANCNFSM6AAAAAAUM7LGGU . You are receiving this because you authored the thread.Message ID: @.*** com>
Not sure what the problem could be then.
Perhaps you could try creating another empty class, and using that one in the config, and then step-by-step add elements from RedisConnectionInfo
until it breaks?
I've went and made a minimal reproduction example. I've added a single class:
export class ConnectionInfo {
constructor(
public host: string,
) {
}
}
And instantiated once, at the top of the main config file:
"@graph": [
{
"@id": "urn:ssv:ConnectionInfo",
"@type": "ConnectionInfo",
"host": "localhost"
},
{
"@id": "urn:ssv:SessionManager",
"@type": "SessionManager",
"info": {
"@id": "urn:ssv:ConnectionInfo"
},
[...]
Context and components files get updated as expected, but at runtime I still get the invalid predicated IRI error. One thing to notice is that if I remove the usage from the SessionManager
class then the error disappears, but I don't know the reason for this.
You can find this at the cjs-issue-141 branch.
I believe I've found the issue, in the config declaration "type": "SomeType"
is of course not the same as "@type": "SomeType"
.
Perhaps a better error description, or just a warning when using "type"
instead of "@type"
would be an improvement.
Ah, of course, good catch :-)
Perhaps a better error description, or just a warning when using "type" instead of "@type" would be an improvement.
Warning is difficult, but an alias could definitely be added. Feel free to open an issue or PR!
Issue type:
Description:
I've created this class and generated the context files using componentsjs-generator (3.1.0). At runtime, componentsjs throws with the error below. Here is the config file.
As you can see, using, what I assume is a more precise path, for the other parameters I get no error but this is not ideal. I assume there is something wrong in the project configuration but I can't pin point exactly where. Any help is appreciated.
Environment:
ComponentsJS: 5.3.2 Node: 16.9.0
Crash log: