builder icon indicating copy to clipboard operation
builder copied to clipboard

@builder.io/react 5.0.4: Custom component are not working anymore

Open MaximeGratens opened this issue 1 year ago • 13 comments

Describe the bug Since the new version of the sdk, custom component using

MaximeGratens avatar Oct 07 '24 09:10 MaximeGratens

Hello @MaximeGratens could you please share a small repro case?

sidmohanty11 avatar Oct 07 '24 10:10 sidmohanty11

@MaximeGratens what was the last version where this behaviour worked for you?

samijaber avatar Oct 07 '24 17:10 samijaber

Hey guys,

So basically, we are using the builder.io/react with next js. The version working right now in production is "5.0.1". When I upgraded to version 5.0.4, all

I don't have any small repo to share with you. If I have times this week I will try but it's a basic next js project.

MaximeGratens avatar Oct 08 '24 07:10 MaximeGratens

Still the same issue in 7.0.0. You can ask me more details by mail but for me it seems that the custom component using

MaximeGratens avatar Nov 20 '24 09:11 MaximeGratens

Interesting - I just tried upgrading Next.js to version 15 and React to version 19 while using Builder 7. I got a hydration error, and this is the element that's not loading on the page

image

@samijaber @sidmohanty11

MaximeGratens avatar Nov 20 '24 10:11 MaximeGratens

Steps To Reproduce: . Clone the following repo https://github.com/Manish-Builder-io/next-15-builder-app.git . Install the dependency and run the app, npm install && npm run dev . Visit the following content to observe the error https://builder.io/content/07e0555027df4e0c84c19f375916f171

Manish-Builder-io avatar Nov 20 '24 12:11 Manish-Builder-io

Hello guys,

Any news on this topic?

MaximeGratens avatar Dec 03 '24 16:12 MaximeGratens

Hello everyone,

I don't know if I can get a due date for this problem. We can't update the version and everything is there to reproduce :(

@samijaber @sidmohanty11

MaximeGratens avatar Jan 17 '25 06:01 MaximeGratens

We've recently updated to the latest:

    "@builder.io/react": "^8.0.9",
    "@builder.io/sdk": "^6.0.4",

Finally, it works!

nasyrovforbes avatar Feb 17 '25 10:02 nasyrovforbes

Marking this as closed given that it it resolved.

Let us know if you still face any issues

samijaber avatar Feb 21 '25 19:02 samijaber

Hello it's not closed, still have the same issue

MaximeGratens avatar Feb 25 '25 11:02 MaximeGratens

@MaximeGratens As we are currently unable to reproduce this issue, we would need a reproduction (in the form of a Custom Component whose <script> isn't loading) to be able to help you further

samijaber avatar Feb 26 '25 15:02 samijaber

To reproduce:

  • Download Manish's repo
  • Add our builder public key: 1961e426a4c24256b0bf32de6a12ec6e
  • Run npm install & npm run dev
  • Navigate to http://localhost:3000/-with-visa
  • Check the section (I added a picture of it)
  • The script is not loading. Here is the content of the script:
<script>
    if (typeof window !== 'undefined') {
        const sectionCountries = document.querySelector('.section-countries')
        const cardPortugal = document.querySelector('.card-portugal')
        const cardItalia = document.querySelector('.card-italia')
  
        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    cardPortugal.style.marginRight = '0'
                    cardPortugal.style.transform = 'none'
  
                    cardItalia.style.marginLeft = '0'
                    cardItalia.style.transform = 'none'
                }
            } )
        }, {
            threshold: 0.5,
        });
  
        observer.observe(sectionCountries);
    }
</script>

You can check our homepage here to see the normal behavior. Image

MaximeGratens avatar Mar 03 '25 04:03 MaximeGratens