Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems running HTML code locally #260

Open
natalialuzuriaga opened this issue Nov 26, 2024 · 1 comment
Open

Problems running HTML code locally #260

natalialuzuriaga opened this issue Nov 26, 2024 · 1 comment

Comments

@natalialuzuriaga
Copy link

natalialuzuriaga commented Nov 26, 2024

Hi! I'm trying to get the following HTML code from the README.md to run locally:

<html>
    <head>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uswds/3.1.0/css/uswds.min.css">
        <link rel="stylesheet" href="https://cdn.form.io/js/formio.form.min.css">
        <link rel="stylesheet" href="https://cdn.form.io/uswds/uswds.min.css">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/uswds/3.1.0/js/uswds.min.js"></script>
        <script src="https://cdn.form.io/js/formio.form.min.js"></script>
        <script src="https://cdn.form.io/uswds/uswds.min.js"></script>
    </head>
    <body>
        <div id="formio"></div>
        <script type="text/javascript">
            Formio.use(uswds);
            Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/example');
        </script>
    </body>
</html>

I get the following error: Uncaught ReferenceError: Formio is not defined. Similarly after looking into the code, I also get an error that the uswds object is also not defined.

Some solutions I tried and were unsuccessful:

  • Changing the USWDS version number from 3.1.0 to 2.11.2 to 2.7.0
  • Added https://unpkg.com/[email protected]/dist/formio.full.min.js as a script. This resolves the Formio is not defined error and renders the form, however uswds object is still undefined.

Are there any css links and/or javascript files that I add or change to the code above? I would appreciate any help with trying to get this to run successfully.

@lane-formio
Copy link
Contributor

I've updated https://cdn.form.io/js
Can you try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants