question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]makePopup is not a function when trying to implement typeform popover inReact/Gatsby

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

2reactions
HairMachinecommented, Mar 2, 2021

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).

2reactions
lucashu1commented, Mar 2, 2021

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 regular import statement, but that didn’t seem to fix it. Any pointers would be appreciated!

TypeError: _typeform_embed__WEBPACK_IMPORTED_MODULE_7__["makeWidget"] is not a function. (In '_typeform_embed__WEBPACK_IMPORTED_MODULE_7__["makeWidget"](elm, url, options)', '_typeform_embed__WEBPACK_IMPORTED_MODULE_7__["makeWidget"]' is undefined)
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found