import icon indicating copy to clipboard operation
import copied to clipboard

getCallerUrl fallback to avoid invalid URL error

Open 7flash opened this issue 9 months ago • 0 comments

I have encountered following error while running example from unit as compiled executable

error: Uncaught (in promise) TypeError: Invalid URL: 'undefined'
    at <anonymous> (ext:deno_url/00_url.js:89:11)

To reproduce, create sep28.ts

import { dynamicImport, importString } from './mod.ts';

const { default: renderer } = await importString(
	`export default async function () {
	const { render } = await dynamicImport('https://deno.land/x/[email protected]/mustache.ts');

	const template = '{{foo}}, {{bar}}!'
	const view = {
		foo: 'Hello',
		bar: 'World!'
	}
	const output = render(template, view)

	return output;
};`,
	{ parameters: { dynamicImport } },
);

console.log(await renderer());

Then compile

deno compile --allow-all --unstable --no-check sep28.ts

7flash avatar Sep 27 '23 18:09 7flash