[Sage 10] Deploying via FTP

Hi there!

I got an issue with deploying a site via FTP. I did use Sage 9 before, and it was very simple, no issues at all on deploying the site, there was also a dist folder from what I remember.

However, when I compile Sage 10, its as if nothing happens.

The command I used: npm run-script build:production

Here’s the screenshot: https://i.imgur.com/YvbV7aZ.png

Blade is not compiled.

Also, what folders should I even upload to the FTP? This is what I uploaded: https://i.imgur.com/WpAItO9.png

Any help would be appriciated!

I am not sure I understand the answer. I do have these files on the server if you look at one of the screenshots and it doesn’t work.

Specifically this code breaks it:

@if ( have_rows( 'flexible_content' ) ) 

@while ( have_rows( 'flexible_content' ) ) <?php the_row(); ?>

    @if ( have_rows( 'row' ) )

    @while ( have_rows( 'row' ) ) <?php the_row(); ?>

    <x-section bgColor="{{ $page[$count]['backgroundColor'] }}" gutter="{{ $page[$count]['gutter']}}" container="{{ $page[$count]['container'] }}">

        @if ( have_rows( 'column' ) )

        @while ( have_rows( 'column' ) ) <?php the_row(); ?>

        <div class="{{ $page[$count]['columnWidth'] }}">

            <?php 

                $layout = get_row_layout();

                $layoutConverted = str_replace( '_', '-', $layout);

                $file = ( $flexibleContentPath . str_replace( '_', '-', $layout) . '.blade.php' );

 

            ?>

            @if( file_exists( $file ))

                @include('blocks.' . $layoutConverted)

            @endif

        </div>

        @endwhile

        @endif

            

    </x-section>

    @endwhile

    @endif

    <?php $count++; ?>

@endwhile

@endif

And its the x-section that breaks it, if I remove x-section blade component and inside stuff, it will work.

So you use an ACF field for including a partial, but you are pre-processing the partial path string first (replacing some parts).
The views/ folder must be available on the server so the partial can be included.

What do you see in the server logs? Are you also using a staging server?

I’ve uploaded every folder, all folders are uploaded.

I am using Digital Ocean, I’ve decided to just use FTP for now and play around on how to set up a proper environment later, as I need to get this deployed ASAP.

I just checked the logs actually, and this is what I get:

[Mon Apr 19 13:21:40.523441 2021] [php7:error] [pid 51045] [client 104.219.72.44:50004] PHP Fatal error: require_once(): Failed opening required ‘/var/www/html/wp-content/themes/kayTheddme/bootstrap/app.php’ (include_path=’.:/usr/share/php’) in /var/www/html/wp-content/themes/kayTheddme/functions.php on line 31, referer: http://tipitraining.com/google-site-verification-content-fpk8ez12pdbewljjo9xhbxlv7lhxa9nplpcode87.php

Ummmm. Not sure if that has to do with Digital Ocean itself, and not Sage at this point.

What do you think?

/var/www/html/wp-content/themes/kayTheddme/bootstrap/app.php
So the bootstrap/ folder with the app.php is missing.
Though please note that Windows and *nix differ in their default file system.
*nix file systems are case-sensitive (App.php is not the same as app.php),
while Windows file systems (App.php is the same as app.php).

The folder is on the server, as seen on the screenshot above(and it does have the file inside). It seems to be the default file that sage created, the only thing I modified in that file is added a new ‘collect’, called ‘nav-walker’.

This is the file:
<?php

/*

|--------------------------------------------------------------------------

| Create The Application

|--------------------------------------------------------------------------

|

| The first thing we will do is create a new Acorn application instance

| which serves as the "glue" for all the components of Laravel, and is

| the IoC container for the system binding all of the various parts.

|

*/

\Roots\bootloader();

/*

|--------------------------------------------------------------------------

| Register Sage Theme Files

|--------------------------------------------------------------------------

|

| Out of the box, Sage ships with categorically named theme files

| containing common functionality and setup to be bootstrapped with your

| theme. Simply add (or remove) files from the array below to change what

| is registered alongside Sage.

|

*/

collect(['helpers', 'setup', 'filters', 'admin', 'nav-walker'])

    ->each(function ($file) {

        if (! locate_template($file = "app/{$file}.php", true, true)) {

            wp_die(

                sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file)

            );

        }

    });

/*

|--------------------------------------------------------------------------

| Enable Sage Theme Support

|--------------------------------------------------------------------------

|

| Once our theme files are registered and available for use, we are almost

| ready to boot our application. But first, we need to signal to Acorn

| that we will need to initialize the necessary service providers built in

| for Sage when booting.

|

*/

add_theme_support('sage');

This topic was automatically closed after 42 days. New replies are no longer allowed.