'Script Component does not work in next.js

I'm working in Tiny Editor, it's necessary to define a key for the editor, following the documentation I can consult this key through the tag <script src = 'address', that's how it works, but when joining the Script component of the next .js (< Script src = 'address') I can't communicate with tiny anymore, has anyone been through this?

# It works
<script src='address' />

# Does not work
<Script src='address' />

doc: https://nextjs.org/docs/basic-features/script



Solution 1:[1]

  • If Script component is inside <Head> component, use it outside <Head>

  • Try in a different browser. It might be browser-specific issue

  • default value for the strategy prop is afterInteractive. with this, script is fetched and executed after the page is interactive. Use beforeInteractive for critical scripts that need to be fetched and executed before the page is interactive.

  • use onError props for debugging.

     onError={(e) => {
            console.error('Script failed to load', e)
          }}
    

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1