Closed literarymachine closed 5 years ago
I get an error on npm run build
and npm run develop
in 10-addHubAndInboxLinks
:
ERROR
UNHANDLED REJECTION Cannot read property 'replace' of undefined
TypeError: Cannot read property 'replace' of undefined
- url-template.js:156 Object.expand
[skohub-ssg]/[url-template]/lib/url-template.js:156:25
- gatsby-node.js:58 compacted.@graph.forEach
/home/fsteeg/git/skohub-ssg/gatsby-node.js:58:29
- Array.forEach
- gatsby-node.js:41 writer.end
/home/fsteeg/git/skohub-ssg/gatsby-node.js:41:25
Local build on master
works fine.
The devil is in the detail, you need to update your .env
with the INBOX and HUB URL templates as described in the .env.example
.
you need to update your .env with the INBOX and HUB URL templates
OK, this works now. I updated the README in https://github.com/hbz/skohub-ssg/pull/22/commits/63a36bec5b7a995367366a499aaf25b28216dbcb.
I have then tried to set it up with a local hub (and updated README in https://github.com/hbz/skohub-ssg/pull/22/commits/532ed5badb0eaceacbeb116974bf1de9fe18d560):
INBOX=http://localhost:3000/inbox?target={id}
HUB=http://localhost:3000/hub
But I get 'Invalid link headers for target URL' for the Inbox
link.
And 'Invalid topic or hub URL' for the Subscribe
button.
But I get 'Invalid link headers for target URL' for the Inbox link. And 'Invalid topic or hub URL' for the Subscribe button.
The Concepts from the Hochschulfaecher Systematik are currently linking to the hub and inboxes of test.skohub.io
:
curl -iL https://w3id.org/class/hochschulfaecher/F17
...
Link: <https://test.skohub.io/inbox?target=http://w3id.org/class/hochschulfaecher/F17#>; rel="http://www.w3.org/ns/ldp#inbox", <https://test.skohub.io/hub>; rel="hub", <http://w3id.org/class/hochschulfaecher/F17#>; rel="self"
...
So basically your local hub tries to validate the requests and rightly identifies that it is not being pointed at. This is expected behavior. I know this can be quite mind bending to grasp, it at least is for me. Perhaps @acka47 can elaborate over a coffee locally in Cologne.
As we agreed that it's sufficient to have one approved review, I am an unassigning me. So, this is ready to be merged then.
Ah, @literarymachine merged it already :)
See e.g. https://test.skohub.io/literarymachine/skos/w3id.org/class/hochschulfaecher/F17.html and https://test.skohub.io/literarymachine/skos/w3id.org/class/hochschulfaecher/F17.json
Fixes #10