Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

getCallerUrl fallback to avoid invalid URL error#20

Open
7flash wants to merge 1 commit intoayoreis:mainfrom
galaxydo:patch-sep28
Open

getCallerUrl fallback to avoid invalid URL error#20
7flash wants to merge 1 commit intoayoreis:mainfrom
galaxydo:patch-sep28

Conversation

@7flash
Copy link
Copy Markdown

@7flash 7flash commented Sep 27, 2023

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/mustache_ts@v0.4.1.1/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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant