snelsi / next-hubspot Goto Github PK
View Code? Open in Web Editor NEW⭐Embed Hubspot forms in your Next.js application
License: MIT License
⭐Embed Hubspot forms in your Next.js application
License: MIT License
Describe the bug
When i wrap my app in the provider i automatically get an error message
I'm on nextJS 12
export default function MyApp({ Component, pageProps }) {
return (
<Component {...pageProps} />
);
}
Here is the error :
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
at HubspotProvider (file:///Users/pierre/Documents/GitHub/projetc/node_modules/next-hubspot/lib/HubspotProvider.js:17:28)
at AuthProvider (webpack-internal:///./lib/auth.tsx:26:19)
at MyApp (webpack-internal:///./pages/_app.tsx:25:18)
at StyleRegistry (/Users/pierre/Documents/GitHub/projetc/node_modules/styled-jsx/dist/index/index.js:671:34)
at AppContainer (/Users/pierre/Documents/GitHub/projetc/node_modules/next/dist/server/render.js:415:29)
at AppContainerWithIsomorphicFiberStructure (/Users/pierre/Documents/GitHub/projetc/node_modules/next/dist/server/render.js:447:57)
at div
at Body (/Users/pierre/Documents/GitHub/projetc/node_modules/next/dist/server/render.js:715:21)
If you have any idea or recommandation :)
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Property 'region' does not exist on type 'IntrinsicAttributes & HubspotFormProps'
Expected behavior
A clear and concise description of what you expected to happen.
Is your feature request related to a problem? Please describe.
I've noticed that when a form is conditionally rendered in Next.js, the HubspotForm component will often render before the form is actually loaded. See GIF at bottom.
Describe the solution you'd like
I'm hopeful that a preload
prop could be added to allow for preloading of the form, which would prevent the blank space from appearing.
Describe alternatives you've considered
I looked into adding a "Loading" indicator, but the loading
prop appears to display true
before the form is displayed
Describe the bug
When I make two separate components for two different forms and use the "useHubspotForm". Then try to load those forms into the same page only one is created.
Is their any solution for this?
Thanks in advanced!
Is there a way for us to only use the form and disable cookie tracking? We want to only collect data via Google Tag Manager since that shows and obeys a consent form.
Describe the bug
Upgrading to next 14.0.1 is causing our form to no longer load.
Desktop (please complete the following information):
Additional context
I added some logging for useHubspotForm
:
formCreated false
error false
loaded false
So it looks like the form isn't loading. I can confirm that the hubspot script tag is present in the html.
The onLoad
callback for the HubspotProvider is also called
It would be nice to improve typing of Hubspot fields in src/hubspot.types.ts
.
Currently, most of the fields are loosely marked as 'unknown function' or 'unknown object'.
My knowledge of Hubspot is too superficial to decipher the types of the arguments by the function name.
Official documentation:
https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options
You can view all fields in your browser by calling console.log(window.hubspot)
and console.log(window.hbspt)
.
I've tried implementing this with the experimental app directory in Next.js 13 using a layout.tsx
and page.tsx
- would be really useful to see how to implement next-hubspot with this situation
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.