Comments (10)
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)
from embed.
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).
from embed.
I'm having the same issue in Gatsby on makePopup. The function is in there but for some reason it is giving below error:
undefined is not a function (near '..._typeform_embed__WEBPACK_IMPORTED_MODULE_2__.makePopup...')
from embed.
I am getting this error on gatsby project too.
TypeError: typeform_embed__WEBPACK_IMPORTED_MODULE_5_.makeWidget is not a function
from embed.
I was able to get this to work in React/Gatsby by running this code on the layout index.tsx:
useEffect(() => {
let mounted = true;
if (mounted) {
const initializeScripts = () => {
loadScript("https://embed.typeform.com/embed.js", () => {
() => {};
});
};
initializeScripts();
}
return () => {
mounted = false;
};
}, []);
Here's loadScript()
export const loadScript = (url: string, cb: GlobalEventHandlers["onload"]) => {
const element = document.getElementsByTagName("script")[0];
const fjs = element;
const js = document.createElement("script");
js.id = "widget-script";
js.src = url;
if (fjs && fjs.parentNode) {
fjs.parentNode.insertBefore(js, fjs);
} else {
document.head.appendChild(js);
}
js.onload = cb;
};
And then I have my component with the link tag and SVG below this at the bottom of my layout index.tsx. I had to use this solution for another 3rd party script that wasn't working in React and figured this was the way. I'm not using this package at all. Hopefully, this will help anyone else having this issue.
from embed.
I got the same error trying to use makeWidget in my nextjs app. On inspection, I only have access to "createWidget" which I am using and it works.
from embed.
Have tried to use and it didn't work. I use simple react app without SSR. Does anyone know how this can be used in React?
from embed.
Had the same issue with React app. Had to revert the package version to a stable one: yarn add @typeform/[email protected]
. It helped.
from embed.
@flppv decided to write my own small wrapper.
from embed.
Latest released version (>= 1) now works with server-side rendering. You can see a demo implementation in Next.js here.
from embed.
Related Issues (20)
- Customize Text colour and Button size - Typeform user feedback (Sidetab) HOT 2
- shareGaInstance not working with NextJs HOT 6
- Option for non minified source code in docs HOT 2
- Raise on incorrect argument types HOT 3
- Correct usage of "container"? HOT 2
- Adding an SVG inside the PopupButton component results in a error when any page interaction happens HOT 1
- test HOT 2
- second test
- test bot
- test test
- [Android Device] For Widget component, when keyboard shows up, it refreshes entire Typeform Widget HOT 5
- Text input loses focus on android devices HOT 2
- Integration with Expo and React native? HOT 3
- Enable pre-loading of a typeform HOT 4
- Ik
- Preview API for the individual response? HOT 1
- Typescript error for partial-element-with-additional-attributes.d.ts HOT 2
- Modal close button needs accessible label HOT 3
- Get answers for an embedded form without server side APIs / access tokens HOT 10
- Missing react types for 4 of the components HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embed.