Skip to content

[6.x]: JqueryAsset fails to resolve under yii2-adapter - 500 on cpresources jquery.js #19262

Description

@vnali

What happened?

Description

My plugin's asset bundle depends on yii\web\JqueryAsset. When running the plugin on Craft 6 with the yii2-adapter, jQuery fails to load.
The browser requests a URL like:
https://xyz.ddev.site/cpresources/9cf87974/jquery.js
Opening the URL directly throws:

InvalidArgumentException
vendor/craftcms/yii2-adapter/legacy/helpers/App.php:1047
jquery.js does not exist.

Steps to reproduce

1- Set up a Craft 6 project using yii2-adapter.
2- Install a plugin whose asset bundle depends on JqueryAsset::class.
3- Load a control panel page that registers this asset bundle.
4- Open browser dev tools, check the Network tab. the request to /cpresources/{hash}/jquery.js returns 500.

Craft CMS version

6.0.0-alpha.13

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions