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

compile(): Return value must be of type string, null returned #2649

Open
mwinandy opened this issue Mar 1, 2024 · 3 comments
Open

compile(): Return value must be of type string, null returned #2649

mwinandy opened this issue Mar 1, 2024 · 3 comments

Comments

@mwinandy
Copy link

mwinandy commented Mar 1, 2024

API Platform version(s) affected: 3.2.15

Description
Assets-mapper fail to compile assets for docs on 7.0.4

In JavaScriptImportPathCompiler.php line 119:

Symfony\Component\AssetMapper\Compiler\JavaScriptImportPathCompiler::compile(): Return value must be of type string, nu
ll returned

On empty project with api v3.2.15 and symfony 7.0.4

How to reproduce

Install empty symfony project, require api via composer and try to open /api/docs or php bin/console debug:asset-map.

Possible Solution
No suggestion but with 7.0.3 no issues.

Additional Context

api-platform/core                   v3.2.15 Build a fully-featured hypermedia or GraphQL API in minutes!
composer/semver                     3.4.0   Semver library that offers utilities, version constraint parsing and valida...
doctrine/cache                      2.2.0   PHP Doctrine Cache library is a popular cache implementation that supports ...
doctrine/collections                2.2.0   PHP Doctrine Collections library that adds additional functionality on top ...
doctrine/dbal                       3.8.2   Powerful PHP database abstraction layer (DBAL) with many features for datab...
doctrine/deprecations               1.1.3   A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging w...
doctrine/doctrine-bundle            2.11.3  Symfony DoctrineBundle
doctrine/doctrine-migrations-bundle 3.3.0   Symfony DoctrineMigrationsBundle
doctrine/event-manager              2.0.0   The Doctrine Event Manager is a simple PHP event system that was built to b...
doctrine/inflector                  2.0.10  PHP Doctrine Inflector is a small library that can perform string manipulat...
doctrine/instantiator               2.0.0   A small, lightweight utility to instantiate objects in PHP without invoking...
doctrine/lexer                      3.0.1   PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive D...
doctrine/migrations                 3.7.2   PHP Doctrine Migrations project offer additional functionality on top of th...
doctrine/orm                        3.0.1   Object-Relational-Mapper for PHP
doctrine/persistence                3.2.0   The Doctrine Persistence project is a set of shared interfaces and function...
doctrine/sql-formatter              1.2.0   a PHP SQL highlighting library
egulias/email-validator             4.0.2   A library for validating emails against several RFCs
masterminds/html5                   2.8.1   An HTML5 parser and serializer.
monolog/monolog                     3.5.0   Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy                   1.11.1  Create deep copies (clones) of your objects
nelmio/cors-bundle                  2.4.0   Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony a...
nikic/php-parser                    v5.0.1  A PHP parser written in PHP
phar-io/manifest                    2.0.3   Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                     3.2.1   Library for handling version information and constraints
phpdocumentor/reflection-common     2.2.0   Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock   5.3.0   With this component, a library can provide support for annotations via DocB...
phpdocumentor/type-resolver         1.8.2   A PSR-5 based resolver of Class names, Types and Structural Element Names
phpstan/phpdoc-parser               1.26.0  PHPDoc parser with support for nullable, intersection and generic types
phpunit/php-code-coverage           9.2.30  Library that provides collection, processing, and rendering functionality f...
phpunit/php-file-iterator           3.0.6   FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker                 3.1.1   Invoke callables with a timeout
phpunit/php-text-template           2.0.4   Simple template engine.
phpunit/php-timer                   5.0.3   Utility class for timing
phpunit/phpunit                     9.6.17  The PHP Unit Testing framework.
psr/cache                           3.0.0   Common interface for caching libraries
psr/clock                           1.0.0   Common interface for reading the clock.
psr/container                       2.0.2   Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                1.0.0   Standard interfaces for event handling.
psr/link                            2.0.1   Common interfaces for HTTP links
psr/log                             3.0.0   Common interface for logging libraries
sebastian/cli-parser                1.0.1   Library for parsing CLI options
sebastian/code-unit                 1.0.8   Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup  2.0.3   Looks up which function or method a line of code belongs to
sebastian/comparator                4.0.8   Provides the functionality to compare PHP values for equality
sebastian/complexity                2.0.3   Library for calculating the complexity of PHP code units
sebastian/diff                      4.0.5   Diff implementation
sebastian/environment               5.1.5   Provides functionality to handle HHVM/PHP environments
sebastian/exporter                  4.0.5   Provides the functionality to export PHP variables for visualization
sebastian/global-state              5.0.6   Snapshotting of global state
sebastian/lines-of-code             1.0.4   Library for counting the lines of code in PHP source code
sebastian/object-enumerator         4.0.4   Traverses array structures and object graphs to enumerate all referenced ob...
sebastian/object-reflector          2.0.4   Allows reflection of object attributes, including inherited and non-public ...
sebastian/recursion-context         4.0.5   Provides functionality to recursively process PHP variables
sebastian/resource-operations       3.0.3   Provides a list of PHP built-in functions that operate on resources
sebastian/type                      3.2.1   Collection of value objects that represent the types of the PHP type system
sebastian/version                   3.0.2   Library that helps with managing the version number of Git-hosted PHP projects
symfony/asset                       v7.0.3  Manages URL generation and versioning of web assets such as CSS stylesheets...
symfony/asset-mapper                v7.0.4  Maps directories of assets & makes them available in a public directory wit...
symfony/browser-kit                 v7.0.3  Simulates the behavior of a web browser, allowing you to make requests, cli...
symfony/cache                       v7.0.4  Provides extended PSR-6, PSR-16 (and tags) implementations
symfony/cache-contracts             v3.4.0  Generic abstractions related to caching
symfony/clock                       v7.0.3  Decouples applications from the system clock
symfony/config                      v7.0.4  Helps you find, load, combine, autofill and validate configuration values o...
symfony/console                     v7.0.4  Eases the creation of beautiful and testable command line interfaces
symfony/css-selector                v7.0.3  Converts CSS selectors to XPath expressions
symfony/debug-bundle                v7.0.3  Provides a tight integration of the Symfony VarDumper component and the Ser...
symfony/dependency-injection        v7.0.4  Allows you to standardize and centralize the way objects are constructed in...
symfony/deprecation-contracts       v3.4.0  A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge             v7.0.4  Provides integration for Doctrine with various Symfony components
symfony/doctrine-messenger          v7.0.4  Symfony Doctrine Messenger Bridge
symfony/dom-crawler                 v7.0.4  Eases DOM navigation for HTML and XML documents
symfony/dotenv                      v7.0.4  Registers environment variables from a .env file
symfony/error-handler               v7.0.4  Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher            v7.0.3  Provides tools that allow your application components to communicate with e...
symfony/event-dispatcher-contracts  v3.4.0  Generic abstractions related to dispatching event
symfony/expression-language         v7.0.3  Provides an engine that can compile and evaluate expressions
symfony/filesystem                  v7.0.3  Provides basic utilities for the filesystem
symfony/finder                      v7.0.0  Finds files and directories via an intuitive fluent interface
symfony/flex                        v2.4.4  Composer plugin for Symfony
symfony/form                        v7.0.4  Allows to easily create, process and reuse HTML forms
symfony/framework-bundle            v7.0.4  Provides a tight integration between Symfony components and the Symfony ful...
symfony/http-client                 v7.0.4  Provides powerful methods to fetch HTTP resources synchronously or asynchro...
symfony/http-client-contracts       v3.4.0  Generic abstractions related to HTTP clients
symfony/http-foundation             v7.0.4  Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                 v7.0.4  Provides a structured process for converting a Request into a Response
symfony/intl                        v7.0.3  Provides access to the localization data of the ICU library
symfony/mailer                      v7.0.4  Helps sending emails
symfony/maker-bundle                v1.55.1 Symfony Maker helps you create empty commands, controllers, form classes, t...
symfony/messenger                   v7.0.4  Helps applications send and receive messages to/from other applications or ...
symfony/mime                        v7.0.3  Allows manipulating MIME messages
symfony/monolog-bridge              v7.0.3  Provides integration for Monolog with various Symfony components
symfony/monolog-bundle              v3.10.0 Symfony MonologBundle
symfony/notifier                    v7.0.3  Sends notifications via one or more channels (email, SMS, ...)
symfony/options-resolver            v7.0.0  Provides an improved replacement for the array_replace PHP function
symfony/password-hasher             v7.0.4  Provides password hashing utilities
symfony/phpunit-bridge              v7.0.4  Provides utilities for PHPUnit, especially user deprecation notices management
symfony/polyfill-intl-grapheme      v1.29.0 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-icu           v1.29.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn           v1.29.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer    v1.29.0 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring           v1.29.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php83              v1.29.0 Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions
symfony/process                     v7.0.4  Executes commands in sub-processes
symfony/property-access             v7.0.4  Provides functions to read and write from/to an object or array using a sim...
symfony/property-info               v7.0.3  Extracts information about PHP class' properties using metadata of popular ...
symfony/routing                     v7.0.3  Maps an HTTP request to a set of configuration variables
symfony/runtime                     v7.0.3  Enables decoupling PHP applications from global state
symfony/security-bundle             v7.0.4  Provides a tight integration of the Security component into the Symfony ful...
symfony/security-core               v7.0.3  Symfony Security Component - Core Library
symfony/security-csrf               v7.0.3  Symfony Security Component - CSRF Library
symfony/security-http               v7.0.4  Symfony Security Component - HTTP Integration
symfony/serializer                  v7.0.4  Handles serializing and deserializing data structures, including object gra...
symfony/service-contracts           v3.4.1  Generic abstractions related to writing services
symfony/stimulus-bundle             v2.16.0 Integration with your Symfony app & Stimulus!
symfony/stopwatch                   v7.0.3  Provides a way to profile code
symfony/string                      v7.0.4  Provides an object-oriented API to strings and deals with bytes, UTF-8 code...
symfony/translation                 v7.0.4  Provides tools to internationalize your application
symfony/translation-contracts       v3.4.1  Generic abstractions related to translation
symfony/twig-bridge                 v7.0.4  Provides integration for Twig with various Symfony components
symfony/twig-bundle                 v7.0.4  Provides a tight integration of Twig into the Symfony full-stack framework
symfony/ux-turbo                    v2.16.0 Hotwire Turbo integration for Symfony
symfony/validator                   v7.0.4  Provides tools to validate values
symfony/var-dumper                  v7.0.4  Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter                v7.0.4  Allows exporting any serializable PHP data structure to plain PHP code
symfony/web-link                    v7.0.3  Manages links between resources
symfony/web-profiler-bundle         v7.0.4  Provides a development tool that gives detailed information about the execu...
symfony/yaml                        v7.0.3  Loads and dumps YAML files
theseer/tokenizer                   1.2.2   A small library for converting tokenized PHP source code into XML and poten...
twig/extra-bundle                   v3.8.0  A Symfony bundle for extra Twig extensions
twig/twig                           v3.8.0  Twig, the flexible, fast, and secure template language for PHP
webmozart/assert                    1.11.0  Assertions to validate method input/output with nice error messages.
willdurand/negotiation              3.1.0   Content Negotiation tools for PHP provided as a standalone library.
@Ordwen
Copy link

Ordwen commented Mar 4, 2024

This error also occurs in Symfony 6.4.

In my case, it's only in the production environment, and when using AssetMapper (v6.4.4).
If I remove AssetMapper, API Platform works correctly.

@vladAyeps
Copy link

Updating symfony/asset-mapper from 6.4.4 -> 6.4.5 ( 7.0.4 -> 7.0.5) resolved the issue.

@langziyang
Copy link

same error: symfony 7.0.5,api 3.2.19

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

4 participants