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

After installing and activate WebpackEncore i can't access to current theme #3351

Open
celtic34fr opened this issue Nov 9, 2022 · 3 comments

Comments

@celtic34fr
Copy link

I installed and activated Webpack Encore (last version) according to the documentation (for Bolt CMS 5.0).
After, I create a new Controller with its template. I want to base this template on the _master.twig template from the base-2021 theme.
But the application cannot find the base-2021 theme resources (CSS and JavaScript files).
Even if I specify the name of a package or not in the asset directive of TWIG, I always have the same result:
with package name:

...
    <link rel="stylesheet" href="{{ asset('css/base-2021.css', 'theme') }}"/>
...```
without package name:
```An exception has been thrown during the rendering of a template ("Asset manifest file "/...../public/build/manifest.json" does not exist. Did you forget to build the assets with npm or yarn?" ).```

I think the documentation is not precise enough or there is a malfunction in Bolt CMS when Webpack Encore is enabled. That's why I'm submitting this problem as a bug rather than an error in the documentation.

Details
-------

| Question                                              | Answer
|------------------------------------------------------ | ------
| Relevant Bolt Version                                 | 5.1.18
| Install type                                          |  Composer install 
| <abbr title="Backwards Compatibility">BC</abbr> Break | yes/no : I don't know
| PHP version                                           | 8.1 |
| Web server                                            | Built-in, version [ Symfony CLI version 5.4.17 ]
| For UX/UI issues                                      | Firefox 106.0.5 (x64 - Linux Ubuntu 22.04)

@bobdenotter
Copy link
Member

It's not supposed to work like that, i think.. Webpack is for bolt itself. The themes should be agnostic, and separate from that. What are you trying to achieve?

@celtic34fr
Copy link
Author

Ok, but that shouldn't interfere with the mechanics implemented by Bolt. Do I understand that using Webpack breaks everything I can do to use a theme for the front end of my project? Because before installing Webpack, I was able to use a theme that I develop from the theme skeleton that comes with Bolt. What do you recommend doing if you want to integrate Webpack into a Bolt project? Should you rather work without Webpack to have access to all of Bolt's features?

@jbarbin
Copy link
Contributor

jbarbin commented Jan 13, 2024

Hello @celtic34fr, i don't know if you still need help but I followed that documentation and all works fine for me : https://docs.boltcms.io/5.2/howto/encore-setup

I hope this could help you :)

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