Laravel-JS-Localization icon indicating copy to clipboard operation
Laravel-JS-Localization copied to clipboard

Undefined offset error (fresh install)

Open nunodonato opened this issue 4 years ago • 1 comments

Hi I've just installed this package in a laravel 7 app (php 7.3). All ok, except when I run php artisan lang:js this is what I get:

In LangJsGenerator.php line 215:
                       
  Undefined offset: 3  

The only thing different in this project is that the vendor folder is outside the main project folder. Not sure if could be related Any tips?

nunodonato avatar Feb 09 '22 12:02 nunodonato

Further digging into it revealed its a problem with a vendor translation that has a .php file mixed with other .json files. The code that converts the file names to keys is expecting a 4 character extension, and gets confused when it meets the .php file

this is in LangJsGenerator.php $key = substr($pathName, 0, -4);

nunodonato avatar Feb 09 '22 12:02 nunodonato