-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not find a valid import path for src/lib/MyActor.jsonld. 'lsd:importPaths' in package.json may be invalid. #102
Comments
Thanks for reporting! |
My package.json file
|
What tutorial are you following exactly (there are multiple)? |
the tutorial I'm following is in the repository readme |
Can you try moving your |
ok, I moved the index to the src folder and I changed my json.package
but the error continued
MyActor class does not generate jsonld components.jsonld
context.jsonld
|
Hmm, that doesn't seem to be the cause of the problem then. Can you try setting your |
I tried again another way. I modified the package.json file with the information contained in the repository Before (package.json)
After (package.json)
I added the following parameters
the npm build command worked and generated the jsonld of the MyActor.ts class
MyActor.jsonld
.componentsjs-generator-config.json
however, I found three problems
|
Thanks for the findings @leorumma!
The lib folder is correct though, since that is that you've defined in your
(but this should be the default when using
So there must be some other difference between your package and the example package. |
I had a brief look at this, since I've also have experienced troubles when trying to set Using: I put a breakpoint at: https://github.com/LinkedSoftwareDependencies/Components-Generator.js/blob/master/lib/generate/Generator.ts#L139 and to inspect the I find that the See the following two examples: Example 1 For a
The inspected {
name: "@antwika/lock",
version: "0.0.1",
moduleIri: "https://linkedsoftwaredependencies.org/bundles/npm/@antwika/lock",
componentsPath: "E:\\Dev\\antwika\\lock\\dist\\components\\components.jsonld",
contexts: {
"https://linkedsoftwaredependencies.org/bundles/npm/@antwika/lock/*/components/context.jsonld": "dist/components/context.jsonld",
},
importPaths: {
"https://linkedsoftwaredependencies.org/bundles/npm/@antwika/lock/*/components/": "dist/components/",
"https://linkedsoftwaredependencies.org/bundles/npm/@antwika/lock/*/dist/": "dist/",
},
typesPath: "E:\\Dev\\antwika\\lock\\dist\\index",
prefix: undefined,
} This works as expected. Example 2 For a
The inspected {
name: "@antwika/lock",
version: "0.0.1",
moduleIri: "https://linkedsoftwaredependencies.org/bundles/npm/@antwika/lock",
componentsPath: "E:\\Dev\\antwika\\lock\\components\\components.jsonld",
contexts: {
"https://linkedsoftwaredependencies.org/bundles/npm/@antwika/lock/^0.0.0/components/context.jsonld": "components/context.jsonld",
},
importPaths: {
"https://linkedsoftwaredependencies.org/bundles/npm/@antwika/lock/^0.0.0/components/": "components/",
"https://linkedsoftwaredependencies.org/bundles/npm/@antwika/lock/^0.0.0/config/": "config/",
},
typesPath: "E:\\Dev\\antwika\\lock\\dist\\index",
prefix: undefined,
} This does not work and throws an error here
Notice the absence of |
Thanks for the findings @ixuz!
That is intentional (but perhaps shouldn't be). If lsd:module is set to true, then all other lsd: entries in the package.json will be overwritten: https://github.com/LinkedSoftwareDependencies/Components.js/blob/master/lib/loading/ModuleStateBuilder.ts#L175-L220 I'm definitely open to a change in this logic so that if lsd:module is true, only those lsd: entries that have not been explicitly defined will be generated. |
Do the findings in #111 (comment) help resolving any problems here? |
Issue type:
Description:
I'm following the tutorial. But I get this error when running the command npm run build
I'm not able to generate MyActor.jsonld file automatically
Environment:
Crash log:
The text was updated successfully, but these errors were encountered: