Skip to content

[AssetMapper] Timeout with JavascriptSequenceParser #60516

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

Open
jmsche opened this issue May 22, 2025 · 2 comments
Open

[AssetMapper] Timeout with JavascriptSequenceParser #60516

jmsche opened this issue May 22, 2025 · 2 comments

Comments

@jmsche
Copy link
Contributor

jmsche commented May 22, 2025

Symfony version(s) affected

7.3.0-beta2 (& beta1)

Description

Hi, after trying to upgrade to Symfony 7.3.0 (first to beta1, then to beta2) I encountered the same issue on both versions.

The issue being:

Error: Maximum execution time of 30 seconds exceeded
vendor/symfony/asset-mapper/Compiler/Parser/JavascriptSequenceParser.php:93
preg_match($this->pattern, $this->content, $matches, \PREG_OFFSET_CAPTURE, $this->cursor);

Downgrading to Symfony 7.2.x fixes the issue.

I finally made some investigations today, and it seems a plugin for Prismjs (the "bash" plugin) causes the issue, but I don't exactly know why AssetMapper stops on it.
If I remove this specific dependency from the importmap it works without issues.

How to reproduce

git clone https://github.com/jmsche/asset-mapper-7.3-prismjs.git
cd asset-mapper-7.3-prismjs
composer install
symfony serve -d
symfony open:local

You can check the symfony-7.2 branch, where the only change is a Symfony downgrade.

Note that switching back to the main branch & running composer install works, but if you drop the cache (rm -rf var/cache/*) it will start to fail again.

Possible Solution

No response

Additional Context

No response

@xabbuh
Copy link
Member

xabbuh commented May 22, 2025

/cc @smnandre

@MatTheCat
Copy link
Contributor

Seems that the JavascriptSequenceParser doesn’t support regular expression literals: if one contains a quote it will be interpreted as the start of a string literal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy