Title: Scripts give fatal errors.
Last modified: November 17, 2021

---

# Scripts give fatal errors.

 *  Resolved [ildomandatore](https://wordpress.org/support/users/ildomandatore/)
 * (@ildomandatore)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/scripts-give-fatal-errors/)
 * I should enter script code of a JS program, but it gives me error.
 * I even tried to add;
 *     ```
       <script type="text/javascript">
       </script>
       ```
   
 * And I get a serious error.
 *     ```
       Don't Panic
       The code snippet you are trying to save produced a fatal error on line 498:
   
       Return type of WP_Hook::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
       The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.
   
       Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.
       ```
   
 * I am a newbie on the JS and I am following this guide.
    [https://github.com/ethanaobrien/emulatorjs](https://github.com/ethanaobrien/emulatorjs)
 * I don’t know where to put the folders I add via FTP. I guess the part of the 
   code with the DIVs should be added in the HTML of the affected page.
 * But the script doesn’t want to start and I don’t understand why. I put the url
   of the game and did various tests. Even if I’m a beginner, I think something 
   is missing or there is a serious problem.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fscripts-give-fatal-errors%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/scripts-give-fatal-errors/#post-15083361)
 * Code Snippets is (currently) only designed for working directly with PHP code.
   That does not mean that you can’t add HTML code like this, but you do need to
   tell WordPress exactly where you want it to go.
 * For the example you gave, you could add a shortcode which contains this code,
   and then just insert that shortcode into a post:
 *     ```
       add_shortcode( 'emulatorjs', function () {
           ob_start();
           ?>
   
       <!-- code goes here -->
   
       <div style="width:640px;height:480px;max-width:100%">
         <div id="game"></div>
       </div>
       <script type="text/javascript">
           EJS_player = '#game';
           EJS_biosUrl = ''; // Url to Famicom Disk System bios
           EJS_gameUrl = ''; // Url to Game rom
           EJS_core = 'nes';
           EJS_lightgun = false; // Lightgun
           EJS_pathtodata = 'data/'; //path to all of the wasm and js files. MUST all be in the same directory!!
       </script>
       <script src="data/loader.js"></script>
   
           <?php
           return ob_get_clean();
       } );
       ```
   
 *  Thread Starter [ildomandatore](https://wordpress.org/support/users/ildomandatore/)
 * (@ildomandatore)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/scripts-give-fatal-errors/#post-15084734)
 * I suspect there is something that is not going to be right; I only need the code
   for one page, because I’m going to put some more.
 * Maybe you mean this;
 *     ```
       add_shortcode( 'emulatorjs', function () {
           ob_start();
           ?>
   
       <!-- code goes here -->
   
       <script type="text/javascript">
           EJS_player = '#game';
           EJS_biosUrl = ''; // Url to Famicom Disk System bios
           EJS_gameUrl = ''; // Url to Game rom
           EJS_core = 'nes';
           EJS_lightgun = false; // Lightgun
           EJS_pathtodata = 'data/'; //path to all of the wasm and js files. MUST all be in the same directory!!
       </script>
       <script src="data/loader.js"></script>
   
           <?php
           return ob_get_clean();
       } );
       ```
   
    -  This reply was modified 4 years, 6 months ago by [ildomandatore](https://wordpress.org/support/users/ildomandatore/).
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/scripts-give-fatal-errors/#post-15087098)
 * The actual HTML/JS code was just an example. Have you tried the snippet you posted
   to see if it works?
 *  Thread Starter [ildomandatore](https://wordpress.org/support/users/ildomandatore/)
 * (@ildomandatore)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/scripts-give-fatal-errors/#post-15087409)
 * Yes I tried it and you don’t even see the loader.
 *  Thread Starter [ildomandatore](https://wordpress.org/support/users/ildomandatore/)
 * (@ildomandatore)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/scripts-give-fatal-errors/#post-15151264)
 * I slightly modify the question; I should change the CSS on the page, but I get
   errors for the wrong syntax. With Givewp, they made me write code to put before
   and after my code.
 * What should I write? I no longer have Givewp.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Scripts give fatal errors.’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [ildomandatore](https://wordpress.org/support/users/ildomandatore/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/scripts-give-fatal-errors/#post-15151264)
 * Status: resolved