-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[AssetMapper] JavaScriptImportPathCompiler::compile(): Return value must be of type string, null returned #54078
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
Comments
Same for Symfony 7.0.4
|
The |
Can you try this diff? Does that help? --- a/src/Symfony/Component/AssetMapper/Compiler/JavaScriptImportPathCompiler.php
+++ b/src/Symfony/Component/AssetMapper/Compiler/JavaScriptImportPathCompiler.php
@@ -31,13 +31,12 @@ final class JavaScriptImportPathCompiler implements AssetCompilerInterface
* @see https://regex101.com/r/1iBAIb/1
*/
private const IMPORT_PATTERN = '/
- ^
- (?:\/\/.*) # Lines that start with comments
+ ^(?:\/\/.*) # Lines that start with comments
|
(?:
- \'(?:[^\'\\\\\n]|\\\\.)*\' # Strings enclosed in single quotes
+ \'(?:[^\'\\\\\n]|\\\\.)*+\' # Strings enclosed in single quotes
|
- "(?:[^"\\\\\n]|\\\\.)*" # Strings enclosed in double quotes
+ "(?:[^"\\\\\n]|\\\\.)*+" # Strings enclosed in double quotes
)
|
(?: # Import statements (script captured)
@@ -49,7 +48,7 @@ final class JavaScriptImportPathCompiler implements AssetCompilerInterface
|
\bimport\(
)
- \s*[\'"`](\.\/[^\'"`\n]+|(\.\.\/)*[^\'"`\n]+)[\'"`]\s*[;\)]
+ \s*[\'"`](\.\/[^\'"`\n]++|(\.\.\/)*+[^\'"`\n]++)[\'"`]\s*[;\)]
?
/mx';
|
Hey @nicolas-grekas YES! I apply (manually) your diff and now the import is correctly made with no errors.
|
Cool. Up for a PR? |
Thanks for the Fix. |
Other quick fix: Add this to your "conflict": {
"symfony/asset-mapper": "7.0.4"
}, |
@Chris53897 no. Open issues are the unresolved. |
reopening as the linked PR isn't merged yet |
…n in regex (PhilETaylor) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [AssetMapper] Fix `JavaScriptImportPathCompiler` regression in regex | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | Fix #54078 | License | MIT Fixes regression in regex, fix provided by `@nicolas`-grekas in #54078 Commits ------- ae16b2d [AssetMapper] Fix `JavaScriptImportPathCompiler` regression in regex
…PCRE error (smnandre) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [AssetMapper] Throw exception in Javascript compiler when PCRE error | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #... | License | MIT `preg_match_callback` can return null when a PCRE error occured, leading there to a TypeError. Let's throw an exception and expose the error message. (follows #54078 / complementary to #54079 ) Commits ------- 2333b58 [AssetMapper] Throw exception in Javascript compiler when PCRE error
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
6.4.4
Description
Regression in AssetMapper 6.4.4 released today
How to reproduce
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: