GUI Breaks, when resolving reference
Hey Mohammad,
I just checked your merge and tested a bit. The original issue is gone, but the GUI breaks when doing the following:
simplescreenrecorder-2023-02-12_11.22.46
I just resolve areference by clicking the 3 dots.
Here the full error message:
Unhandled Rejection (Error): Could not normalize url "../uploads/nS9ReOSKTYOhpabydwqJ2A/archive/1u5n_62mZMfO7BTRzt5kTLfXfEeE#/data" with baseUrl "undefined": a baseUrl is required.
resolveNomadUrl
src/utils.js:1123
1120 |
1121 | if (parsedUrl.relativeTo) {
1122 | // Url is relative.
> 1123 | if (!baseUrl) throw new Error(prefix + 'a baseUrl is required.')
| ^ 1124 | const parsedBaseUrl = parseNomadUrl(baseUrl)
1125 | if (!parsedBaseUrl.isResolved) throw new Error(prefix + 'unresolved baseUrl')
1126 | // Copy data from parsedBaseUrl
resolveValue
src/components/editQuantity/ReferenceEditQuantity.js:294
291 | return
292 | }
293 | const resolveValue = async () => {
> 294 | const resolvedUrl = resolveNomadUrl(value, url)
| ^ 295 | if (resolvedUrl.type !== refType.archive && resolvedUrl.type !== refType.metainfo) {
296 | throw new Error(`Expected archive or metainfo reference, got ${resolvedUrl.type} type for ${value}`)
297 | }
ReferenceEditQuantity/<
src/components/editQuantity/ReferenceEditQuantity.js:333
330 | setError('The referenced value does not exist anymore')
331 | }
332 | }
> 333 | resolveValue()
| ^ 334 | }, [api, url, value])
335 |
336 | const getReferencePath = useCallback((value) => {
Can you have a look?
Best Micha