Yii Framework Forum: Wrong path to bower assets - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Wrong path to bower assets Rate Topic: -----

#1 User is offline   dataskills 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 06-August 13

Posted 19 July 2017 - 12:15 PM

I just made a fresh install of Yii2 advanced application template.

I got an error when trying to load the front page:
Invalid Parameter – yii\base\InvalidParamException
The file or directory to be published does not exist: /path/to/my/app/appName/vendor/bower/jquery/dist

I looked in the vendor folder and there is no "vendor/bower/jquery/dist" but "vendor/bower-asset/jquery/dist" exists.

I changed the vendor path in yii\base\Application line 461 to:
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower-asset');

Now it works. What is the disconnect here? Any idea?

Posted Image
0

#2 User is offline   dataskills 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 06-August 13

Posted 19 July 2017 - 12:28 PM

View Postdataskills, on 19 July 2017 - 12:15 PM, said:

I just made a fresh install of Yii2 advanced application template.

I got an error when trying to load the front page:
Invalid Parameter – yii\base\InvalidParamException
The file or directory to be published does not exist: /path/to/my/app/appName/vendor/bower/jquery/dist

I looked in the vendor folder and there is no "vendor/bower/jquery/dist" but "vendor/bower-asset/jquery/dist" exists.

I changed the vendor path in yii\base\Application line 461 to:
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower-asset');

Now it works. What is the disconnect here? Any idea?

Posted Image

0

#3 User is offline   dataskills 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 06-August 13

Posted 19 July 2017 - 12:31 PM

I partially understand the cause: I was trying to use asset-packagist. I put the following in composer.json:


"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]

This caused the assets to be put in the aforementioned directories that did not match the yii path aliases for bower and npm assets.

Perhaps someone could shed some light on how that is supposed to work?
0

#4 User is offline   TomaszKane 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 29-July 11

Posted 22 September 2017 - 09:41 AM

Have same issue.
0

#5 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,694
  • Joined: 10-October 10
  • Location:Denmark

Posted 22 September 2017 - 11:54 AM

You don't have to do anything other than install the Composer asset plugin as described on the Yii 2 installation page :)

composer global require "fxp/composer-asset-plugin:^1.3.1"


I misunderstood the issue, sorry!

"Less noise - more signal"
0

#6 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,184
  • Joined: 17-January 09
  • Location:Russia

Posted 22 September 2017 - 01:49 PM

In case you use https://asset-packagist.org you have to define aliases as noted at https://asset-packagist.org/site/about
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark
2

#7 User is offline   TomaszKane 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 29-July 11

Posted 22 September 2017 - 02:31 PM

View Postsamdark, on 22 September 2017 - 01:49 PM, said:

In case you use https://asset-packagist.org you have to define aliases as noted at https://asset-packagist.org/site/about

Yes, I found it here github/yii2. Thanks anyway samdark.
I also read that Yii 2.1 will be free from fxp/composer-asset-plugin problems :-)
0

#8 User is offline   Mehul Mohan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 03-October 17

Posted 03 October 2017 - 11:16 AM

I too am getting the same problem with no luck.
0

#9 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,694
  • Joined: 10-October 10
  • Location:Denmark

Posted 03 October 2017 - 03:04 PM

View PostMehul Mohan, on 03 October 2017 - 11:16 AM, said:

I too am getting the same problem with no luck.


Can you explain your issue clearly and with all the necessary details, please? :)
"Less noise - more signal"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users