[BUG]makePopup is not a function when trying to implement typeform popover inReact/Gatsby
See original GitHub issueDescribe the bug I’ve been trying to follow the guide to embedding a typeform widget in a React component, but I’m receiving a webpack error. I tried to use makePopup too, but also recieved the error. I’m using this code
import React, { useEffect, useRef, useState } from "react";
import * as typeformEmbed from "@typeform/embed";
export const Quiz = () => {
const typeformRef = useRef(null);
const url =
"https://form.typeform.com/to/P9O5wcaX?typeform-medium=embed-snippet";
useEffect(() => {
typeformEmbed.makeWidget(
typeformRef.current,
"https://form.typeform.com/to/MY_TYPEFORM_ID",
{
hideFooter: true,
hideHeaders: true,
opacity: 50
}
);
}, [typeformRef]);
console.log(typeformRef);
return (
<div ref={typeformRef} style={{ height: "100vh", width: "100%" }}></div>
);
};
and receiving this error
Uncaught TypeError: _typeform_embed__WEBPACK_IMPORTED_MODULE_1__.makeWidget is not a function
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
Troubleshooting embedded typeforms - Help Center
I want to hide the scrollbar in my embed. Since the embedded typeform is essentially an embedded webpage, the scrollbar can't be removed....
Read more >Embed your typeform - Help Center
Embedding typeforms on websites using the insecure and unencrypted HTTP protocol is not supported. Make sure to embed your form on an HTTPS...
Read more >Advanced embed options - Help Center - Typeform
1. Go to the Share panel and click Embed in a web page. · 2. Alternately, if your typeform hasn't yet been published,...
Read more >What to do if your typeform isn't working - Help Center
Now close and restart your browser, and try your typeform again. 3. Disable any plugins/extensions on your current browser, as these might affect...
Read more >Trying to Embed POPUP form which has redirection on ...
I have linked one Typeform to another by using 'Redirection on ... //this is not working onSubmit: function() { console.log("Typeform ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I also see this in Vue. There is a createWidget function in there though! I’m not sure if it’s the same thing or not; I get an InnerHTML error when I pass the element into that (this could still be user error on my part).
Getting a similar error with Next.js. My guess is that it has something to do with server-side rendering, but I’m not entirely sure.
I also tried importing the module using
next/dynamic
(with SSR disabled) instead of a regularimport
statement, but that didn’t seem to fix it. Any pointers would be appreciated!