• Resolved mix0r

    (@mix0r)


    Hi! Thanks for your work regarding Reactpress.

    We have had no problems in creating a CRA app and pushing it to production, however, when trying to do the same with a clean Vite app (as per your instructions: npx create-vite [your-appname] --template react), pushing it to production (build folder name is “dist”) gives us the error below. We saw that there is a thread about another person wanting to convert from CRA to Vite, and you mentioned that the “dist” folder should be removed? If we remove the “dist” folder, we can access the chosen page but there is no app rendered.

    Many thanks in advance!

    Uncaught TypeError: Return value of ReactPress\Admin\Utils::app_path() must be of the type string, null returned in /home/user/domains/xxxxxx.xx/public_html/wp-content/plugins/reactpress/admin/Utils.php:54 Stack trace: #0 /home/user/domains/xxxxxx.xx/public_html/wp-content/plugins/reactpress/public/User.php(182): ReactPress\Admin\Utils::app_path('xxxxx', true) #1 [internal function]: ReactPress\User\User->ReactPress\User\{closure}('index-BPgokE0a....') #2 /home/user/domains/xxxxxx.xx/public_html/wp-content/plugins/reactpress/public/User.php(185): array_map(Object(Closure), Array) #3 /home/user/domains/xxxxxx.xx/public_html/wp-content/plugins/reactpress/public/User.php(93): ReactPress\User\User->repr_load_react_app() #4 /home/user/domains/xxxxxx.xx/public_html/wp-includes/class-wp-hook.php(324): ReactPress\User\User->enqueue_scripts('') #5 /home/user/domains/xxxxxx.xx/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #6

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author rockiger

    (@rockiger)

    The dist folder must exist with vite. The directory structure should be like this (for a very simple app).

    [APPNAME]
    └── dist
        ├── assets
        │   ├── index-DiwrgTda.css
        │   ├── index-fDP9iUA0.js
        │   └── react-CHdo91hT.svg
        ├── index.html
        └── vite.svg
    
    Thread Starter mix0r

    (@mix0r)

    And that was as simple as that… thank you very much!

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

The topic ‘Problems with fresh Vite-app’ is closed to new replies.