Formio.builder is not a function Error
I am trying to get my custom component included in formio builder navigation bar. I am using below code, however Formio.builder is giving error - Uncaught TypeError: Formio.builder is not a function"
Is there anything missing?
<link rel="stylesheet" href="https://cdn.form.io/js/formio.full.min.css">
<script src="https://cdn.form.io/js/formio.full.min.js"></script>
<div id="builder"></div>
Formio.builder(document.getElementById('builder')
...
...
)
Ran into same problem. I think they haven't updated the documentation. This worked for me using npm package, might work for CDN too.
import { FormBuilder } from "formiojs";
new FormBuilder(document.getElementById('builder'), {}, {});
The links for the script and link tag are missing the prefix formio before the js. The html should look like the following
<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdn.form.io/formiojs/formio.full.min.css'>
<script src='https://cdn.form.io/formiojs/formio.full.min.js'></script>
<div id="builder"></div>
with the javascript being Formio.builder(document.getElementById('builder'),{},{});
For more information on how to create custom component please refer to our help docs