Comments (16)
But I am going to close this one as this is a Symfony specific issue
from foundry.
The library must be within dev
composer section.
I've defined on all factories #[When('dev')] and #[When('test')] and don't use them in production code
I think you called cache:clear
in dev environment, but compose install
was with --no-dev
Try APP_ENV=production composer install
from foundry.
#30 [frankenphp_prod 8/8] RUN set -eux; mkdir -p var/cache var/log var/storage; composer dump-autoload --classmap-authoritative --no-dev; composer dump-env prod; composer run-script --no-dev post-install-cmd; chmod +x bin/console; sync;
#30 0.061 + mkdir -p var/cache var/log var/storage
#30 0.062 + composer dump-autoload --classmap-authoritative --no-dev
#30 0.225 Generating optimized autoload files (authoritative)
#30 9.151 Generated optimized autoload files (authoritative) containing 19049 classes
#30 9.164 + composer dump-env prod
#30 9.375 Successfully dumped .env files in .env.local.php
#30 9.382 + composer run-script --no-dev post-install-cmd
#30 9.549
#30 9.549 Run composer recipes at any time to see the status of your Symfony recipes.
#30 9.549
#30 9.555 Executing script cache:clear [KO]
#30 10.02 [KO]
#30 10.02 Script cache:clear returned with error code 1
#30 10.02 !!
#30 10.02 !! In AbstractRecursivePass.php line 177:
#30 10.02 !!
#30 10.02 !! Invalid service "App\Foundry\PostFactory": class "Zenstru
#30 10.02 !! ck\Foundry\ModelFactory" not found while loading "App\Foundry\Factory\PostFactory".
I think it runs with prod env, because in dunglas/symfony-docker there is ENV APP_ENV=prod
set above the failed instructions
from foundry.
can you send your services.yaml ?
from foundry.
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Security/SecurityIdentity.php'
app.redis:
class: Redis
factory: ['Symfony\Component\Cache\Adapter\RedisAdapter', 'createConnection']
arguments: ['%env(REDIS_DSN)%']
when@prod:
parameters:
.container.dumper.inline_factories: true
from foundry.
You should exclude Factory path for all environments and include into the test/dev
from foundry.
That's what #[When]
attribute does it, no? π
from foundry.
I don't see When attribute in your config
from foundry.
Because attributes are declared on the factories itself
from foundry.
bin/console debug:container βenv=production | grep SomeFactory
from foundry.
This does feel like a Symfony issue especially if it just started happening... Did you upgrade Symfony recently?
from foundry.
Possibly related: symfony/symfony#51106 & symfony/symfony#32995
from foundry.
Sorry, forgot to reply.
bin/console debug:container βenv=production | grep SomeFactory
it does not return it
This does feel like a Symfony issue especially if it just started happening... Did you upgrade Symfony recently?
Possibly related: symfony/symfony#51106 & symfony/symfony#32995
Thanks, that must be it..
Then the workaround probably will be not using attributes :(
from foundry.
But still I don't understand why it started to occur randomly π
from foundry.
Hey @norkunas, does this problem still occur with Foundry v2 / last Symfony version?
from foundry.
It is still the same.
from foundry.
Related Issues (20)
- `make:factory` fails when there is more than one level of embedded classes HOT 2
- Named `FactoryCollection` constructors don't have proper type declarations HOT 4
- Performance Problem with random HOT 3
- Doctrine embeddables with v2 HOT 8
- [Tests] use 2 schemas in the same database
- Migration Guide to version 2 HOT 3
- V2 and phpstan HOT 5
- Upgrade from 1.37 to 1.38 introduce a memory leak HOT 16
- H
- [2.x] ArgumentCountError thrown when passing $attributes array to closure in event HOT 9
- Creation of dynamic property App\Entity\MyEntity::$_autoRefresh is deprecated HOT 6
- Issue with Proxy Entities in Version 2 HOT 14
- Zenstruck\Foundry\Factory::$class must not be accessed before initialization HOT 6
- Find functions do not refresh entity HOT 2
- Attribute wrapped in a Foundry Proxy is not compatible with `Symfony\Component\VarExporter\LazyProxyTrait` HOT 6
- Foundry should not remove symfony-s errorHandlers HOT 6
- Global state relationships and flush_after HOT 13
- How to fix deprecation notices HOT 7
- [2.0] Problem with inversed `OneToOne` relationships HOT 4
- [2.0] No autocompletion for Proxy objects HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundry.