Fix getExtensionPageUrl on Windows

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala committed 2020-12-02 10:51:50 +02:00
1 parent dcf253e7d5
commit 3e7315a2c8
1 file changed
+1 -1
+1 -1
View File
@@ -44,7 +44,7 @@ export function getExtensionPageUrl<P extends object>({ extensionId, pageId = ""
const extensionBaseUrl = compile(`/extension/:name`)({
name: sanitizeExtensionName(extensionId), // compile only with extension-id first and define base path
});
const extPageRoutePath = path.join(extensionBaseUrl, pageId); // page-id might contain route :param-s, so don't compile yet
const extPageRoutePath = path.join(extensionBaseUrl, pageId).replace(/\\/g, "/"); // path.join returns \ as separator on Windows and needs to be replaced with /
if (params) {
return compile(extPageRoutePath)(params); // might throw error when required params not passed