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

Use webpack core for standalone applications #168

Open
eerison opened this issue Apr 12, 2022 · 1 comment
Open

Use webpack core for standalone applications #168

eerison opened this issue Apr 12, 2022 · 1 comment

Comments

@eerison
Copy link

eerison commented Apr 12, 2022

Hello!

I'm trying to create a lib just with templates, and I would like that It works for standalone applications, But I'm get problem with symfony webcore

I'm setting the cache as false, but it's searching for cache system

$containerBuilder = new ContainerBuilder();
$webpackExtension = new WebpackEncoreExtension();
$webpackExtension->load([
    [
        'output_path' => __DIR__ . '/var/build',
        'cache' => false,
    ]
], $containerBuilder);
//$containerBuilder->register('cache.system', \Symfony\Component\Cache\CacheItem::class);
$containerBuilder->compile();

repository with the code

error

( ! ) Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Service "cache.webpack_encore": Parent definition "cache.system" does not exist. in /app/vendor/symfony/dependency-injection/Compiler/ResolveChildDefinitionsPass.php on line 76

Symfony\Component\DependencyInjection\Exception\RuntimeException: Service "cache.webpack_encore": Parent definition "cache.system" does not exist. in /app/vendor/symfony/dependency-injection/Compiler/ResolveChildDefinitionsPass.php on line 76

dependencies

symfony/asset                      v6.0.7  Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files
symfony/cache                      v4.4.40 Provides an extended PSR-6, PSR-16 (and tags) implementation
symfony/cache-contracts            v2.5.1  Generic abstractions related to caching
symfony/config                     v6.0.7  Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/debug                      v4.4.37 Provides tools to ease debugging PHP code
symfony/dependency-injection       v5.4.7  Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts      v3.0.1  A generic function and convention to trigger deprecation notices
symfony/error-handler              v4.4.40 Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher           v4.4.37 Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts v1.1.12 Generic abstractions related to dispatching event
symfony/filesystem                 v6.0.7  Provides basic utilities for the filesystem
symfony/http-client-contracts      v2.5.1  Generic abstractions related to HTTP clients
symfony/http-foundation            v5.4.6  Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                v4.4.40 Provides a structured process for converting a Request into a Response
symfony/polyfill-ctype             v1.25.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring          v1.25.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php73             v1.25.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80             v1.25.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81             v1.25.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/service-contracts          v2.5.1  Generic abstractions related to writing services
symfony/translation                v4.4.37 Provides tools to internationalize your application
symfony/translation-contracts      v2.5.1  Generic abstractions related to translation
symfony/twig-bridge                v4.4.40 Provides integration for Twig with various Symfony components
symfony/var-dumper                 v5.4.6  Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter               v5.4.7  Allows exporting any serializable PHP data structure to plain PHP code
symfony/webpack-encore-bundle      v1.14.0 Integration with your Symfony app & Webpack Encore!
symfony/yaml                       v4.4.37 Loads and dumps YAML files
twig/twig v3.3.10 Twig, the flexible, fast, and secure template language for PHP
@eerison
Copy link
Author

eerison commented Apr 12, 2022

symfony/webpack-encore#1108 (comment)

But if there is a flag as false, why do I need to provide a cache configuration?

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

1 participant