Skip to content

Error when trying to see the page, #59

Open

Description

@amoyano

I am getting this error ,m my wordpress is on Linux AWS, it is the sample app from React,
Wordpress Version 6.5

image

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/app/current/web/app/plugins/reactpress/public/User.php:272 Stack trace: #0 /var/app/current/web/app/plugins/reactpress/public/User.php(93): ReactPress\User\User->repr_load_react_app() #1 /var/app/current/web/wp/wp-includes/class-wp-hook.php(324): ReactPress\User\User->enqueue_scripts('') #2 /var/app/current/web/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /var/app/current/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /var/app/current/web/wp/wp-includes/script-loader.php(2265): do_action('wp_enqueue_scri...') #5 /var/app/current/web/wp/wp-includes/class-wp-hook.php(324): wp_enqueue_scripts('') #6 /var/app/current/web/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #7 /var/app/current/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #8 /var/app/current/web/wp/wp-includes/general-template.php(3050): do_action('wp_head') #9 /var/app/current/web/app/themes/markspain/header.php(42): wp_head() #10 /var/app/current/web/wp/wp-includes/template.php(810): require_once('/var/app/curren...') #11 /var/app/current/web/wp/wp-includes/template.php(745): load_template('/var/app/curren...', true, Array) #12 /var/app/current/web/wp/wp-includes/general-template.php(48): locate_template(Array, true, true, Array) #13 /var/app/current/web/app/themes/markspain/page.php(6): get_header() #14 /var/app/current/web/wp/wp-includes/template-loader.php(106): include('/var/app/curren...') #15 /var/app/current/web/wp/wp-blog-header.php(19): require_once('/var/app/curren...') #16 /var/app/current/web/index.php(5): require('/var/app/curren...') #17 {main} thrown in /var/app/current/web/app/plugins/reactpress/public/User.php on line 272

Also when trying to add pages there are errors:
image

Activity

  1. jpotosme-sjrtd commented on Sep 19, 2024

    @jpotosme-sjrtd

    Currently experiencing the same. Were you able to get this resolved? @amoyano

  2. rockiger commented on Sep 22, 2024

    @rockiger
    Owner

    I don't know how to debug this. The error doesn't make sense to me. I don't know should be offset here.

  3. dylanlawrence commented on Oct 20, 2024

    @dylanlawrence
    Contributor

    I have an error on this page, but it's because it's missing a directory in the path for the reactpress-admin.js.

    REPR_PLUGIN_URL /admin /js/reactpress-admin.js

    #Admin.php - line #92

  4. rockiger commented on Oct 23, 2024

    @rockiger
    Owner

    @dylanlawrence Can you tell me which directory and what OS you are on?

    REPR_PLUGIN_URL is defined whith this code, which should provide the right url:

    define('REPR_PLUGIN_URL', REPR_IS_WINDOWS ? str_replace('\\', '/', plugin_dir_url(__FILE__)) : plugin_dir_url(__FILE__));
    
  5. dylanlawrence commented on Oct 23, 2024

    @dylanlawrence
    Contributor

    Its just looking for a file that is in the /admin directory. [pluginDir]/admin/js/reactpress-admin.js
    REPR_PLUGIN_URL is fine, it is the plugin path.
    The file is empty, just for localizing data or something, but it still has an error in the console.

  6. BlairCooper commented on Feb 1, 2025

    @BlairCooper
    Contributor

    @amoyano , @jpotosme-sjrtd
    Is this still a problem? Which version of ReactPress are you using? If not the current version can you try with that and provide a new stack trace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions