bolt / project

🚀 Repo to `composer create project` a Bolt 5 project.
MIT License
39 stars 38 forks source link

No templates found on installation #44

Closed benr77 closed 3 years ago

benr77 commented 3 years ago

I've just installed Bolt4, configured the database connection, run the set up script to configure the basics and install the fixtures.

Then, when I access the URL in the browser I get the following error:

Unable to find one of the following templates: "index.twig", "index.html.twig".

It seems the entire templates directory is missing.

bobdenotter commented 3 years ago

You probably don't have SQLite on your development machine. See also: https://github.com/bolt/core/issues/1969

benr77 commented 3 years ago

I've configured it to use MySQL not SQLite, and SQLite is installed as well.

From the issue you linked, I've discovered that you need to run

php bin/console bolt:copy-themes

But this does not seem to be part of the documentation or triggered by the setup command

bobdenotter commented 3 years ago

I've configured it to use MySQL not SQLite

That's not relevant. It happens before that.

But this does not seem to be part of the documentation or triggered by the setup command

It really should: https://github.com/bolt/project/blob/master/composer.json#L30-L33

Only times I've seen it fail was when SQLite was malfunctioning during install.

benr77 commented 3 years ago

Ok apologies I've realised the SQLite extension was not enabled during install, so the composer scripts failed. It then fell back to trying MySQL, which to me just looked like missing credentials.

It would be good if the composer scripts would abort with an error message about missing SQLite, as otherwise the entire installation process becomes confusing and painful.

Thanks

ant-on-io commented 1 year ago

2 years later... I just installed Bolt5 following docs.boltcms.io and run into the exact same error as the OP here:

LoaderError
HTTP 500 Internal Server Error
Unable to find one of the following templates: "index.twig", "index.html.twig".

The database was created, sqlite is working: output from bin/console bolt:info

⚙️  Bolt
=======

 Bolt version: 5.1.24

 * Install type: Packaged distribution
 * Database: sqlite 3.39.2 (with JSON)
 * PHP version: 8.2.3
 * Symfony version: v5.4.19
 * Operating System: Windows NT - 10.0
 * Memory limit: 1024M

Running bolt:copy-themes fixes the error, but I see that it's no longer in composer.json.

Also, after running bolt:copy-themes, the website starts up but now I can't access the admin panel at localhost:8000/bolt:

An exception has been thrown during the rendering of a template ("Could not find the entrypoints file from Webpack: the file "C:\dev\web\cking-bolt/public/assets/entrypoints.json" does not exist.").

And no, there is no assets subfolder in public...

ant-on-io commented 1 year ago

Found in abovementioned bolt/core#1969 the solution to that second error:

php bin/console bolt:copy-assets
php bin/console extensions:configure

I do believe that these two (and also bolt:copy-themes) should be executed automatically by bolt:setup but -at least here- they were not