Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work. Template error #4

Open
sdwru opened this issue Sep 22, 2024 · 4 comments
Open

Doesn't work. Template error #4

sdwru opened this issue Sep 22, 2024 · 4 comments
Assignees

Comments

@sdwru
Copy link

sdwru commented Sep 22, 2024

The error is on the lines {{ inertiaHead(page) }} and {{inertia(page) }} in templates/app.html.twig. I see those same functions in the inertia-bundle project which appears to be what this project is based on. Looking at that project, I see those functions defined in Twig/IntertiaExtension.php but I don't see them defined anywhere in this project.

Here is the full stack trace.

Twig\Error\RuntimeError:
An exception has been thrown during the rendering of a template ("Could not resolve host "node".").

  at D:\xampp\htdocs\sviv\templates\app.html.twig:8
  at Twig\Template->displayWithErrorHandling()
     (D:\xampp\htdocs\sviv\vendor\twig\twig\src\Template.php:378)
  at Twig\Template->display()
     (D:\xampp\htdocs\sviv\vendor\twig\twig\src\Template.php:390)
  at Twig\Template->render()
     (D:\xampp\htdocs\sviv\vendor\twig\twig\src\TemplateWrapper.php:45)
  at Twig\TemplateWrapper->render()
     (D:\xampp\htdocs\sviv\vendor\twig\twig\src\Environment.php:318)
  at Twig\Environment->render()
     (D:\xampp\htdocs\sviv\vendor\rompetomp\inertia-bundle\Service\Inertia.php:177)
  at Rompetomp\InertiaBundle\Service\Inertia->render()
     (D:\xampp\htdocs\sviv\src\Controller\WelcomeController.php:18)
  at App\Controller\WelcomeController->welcome()
     (D:\xampp\htdocs\sviv\vendor\symfony\http-kernel\HttpKernel.php:152)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (D:\xampp\htdocs\sviv\vendor\symfony\http-kernel\HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (D:\xampp\htdocs\sviv\vendor\symfony\http-kernel\Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (D:\xampp\htdocs\sviv\vendor\symfony\runtime\Runner\Symfony\HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (D:\xampp\htdocs\sviv\vendor\autoload_runtime.php:29)
  at require_once('D:\\xampp\\htdocs\\sviv\\vendor\\autoload_runtime.php')
     (D:\xampp\htdocs\sviv\public\index.php:5)
@cydrickn
Copy link
Owner

cydrickn commented Sep 25, 2024

may i know what symfony version do you use

@evanh-shumakov
Copy link

The same problem for me. Use the project as it is originally:

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "stable",
    "prefer-stable": true,
    "require": {
        "php": ">=8.1",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "doctrine/annotations": "^1.0",
        "pentatrion/vite-bundle": "^2.0",
        "phpdocumentor/reflection-docblock": "^5.3",
        "phpstan/phpdoc-parser": "^1.6",
        "rompetomp/inertia-bundle": "^2.4",
        "sensio/framework-extra-bundle": "^6.2",
        "symfony/console": "6.1.*",
        "symfony/dotenv": "6.1.*",
        "symfony/flex": "^2",
        "symfony/framework-bundle": "6.1.*",
        "symfony/property-access": "6.1.*",
        "symfony/property-info": "6.1.*",
        "symfony/runtime": "6.1.*",
        "symfony/serializer": "6.1.*",
        "symfony/twig-bundle": "6.1.*",
        "symfony/yaml": "6.1.*",
        "twig/extra-bundle": "^2.12|^3.0",
        "twig/twig": "^2.12|^3.0"
    },
    "config": {
        "allow-plugins": {
            "composer/package-versions-deprecated": true,
            "symfony/flex": true,
            "symfony/runtime": true
        },
        "optimize-autoloader": true,
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php80": "*",
        "symfony/polyfill-php81": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "6.1.*"
        }
    }
}

@evanh-shumakov
Copy link

Just disabled SSR with APP_INERTIA_SSR_ENABLE=false in .env . Didn't suppose to use it.

@sdwru
Copy link
Author

sdwru commented Sep 30, 2024

may i know what symfony version do you use

v6.1

@cydrickn cydrickn self-assigned this Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants