Skip to content

Commit

Permalink
ensure passing of URLs to wcc
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Jun 18, 2022
1 parent 6cd5077 commit 8e4c1d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/lib/ssr-route-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { workerData, parentPort } from 'worker_threads';
import { renderToString } from 'wc-compiler';

async function executeRouteModule({ modulePath, compilation, route, label, id }) {
const module = await import(pathToFileURL(modulePath)).then(module => module);
const moduleURL = pathToFileURL(modulePath);
const module = await import(moduleURL).then(module => module);
const { getFrontmatter = null, getBody = null, getTemplate = null } = module;
const parsedCompilation = JSON.parse(compilation);
const data = {
Expand All @@ -22,8 +23,7 @@ async function executeRouteModule({ modulePath, compilation, route, label, id })
}

if (module.default) {
console.debug('exporting a native custom element', modulePath);
const { html, metadata } = await renderToString(new URL(modulePath, import.meta.url));
const { html, metadata } = await renderToString(moduleURL);
console.debug({ metadata });

data.body = html;
Expand Down

0 comments on commit 8e4c1d9

Please sign in to comment.