Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1662

GovUK-frontend issue: new FileUpload component with Svelte

$
0
0

I am trying to get the new enhanced FileUpload component in govuk-frontend 5.9.0 working in a Svelte 4 and my code looks as follows:

    import {onMount} from 'svelte';    import { FileUpload } from 'govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs';    import { createAll } from 'govuk-frontend/dist/govuk/init.mjs';    onMount(() => {        createAll( FileUpload);    })    // HTML here

However when I try this I get

ReferenceError: HTMLElement is not definedat file:///myapp/node_modules/govuk-frontend/dist/govuk/component.mjs:57:25

Any ideas on how to get round this would be appreciated. I'd prefer not to run createAll/initAll for everything if it can be avoided.


Viewing all articles
Browse latest Browse all 1662

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>