Skip to content

Wrong path to local js #22

@xorock

Description

@xorock

Hi. In file vendor/akaunting/laravel-apexcharts/src/Chart.php, there is an incorrect path to the JS file (with standard Laravel configuration, server root in public).

if (is_file('public/vendor/apexcharts/apexcharts.js')) {
    $path = asset('public/vendor/apexcharts/apexcharts.js');
}

is_file function will always give false, and default path will be used $path = 'https://cdn.jsdelivr.net/npm/apexcharts';

dd(is_file('public/vendor/apexcharts/apexcharts.js')); // false
dd(is_file('vendor/apexcharts/apexcharts.js')); // true

Maybe this setting should be configurable?
Also, for example, php-flasher uses
"@flasher/flasher": "file:vendor/php-flasher/flasher/Resources" in package.json that allows importing the file while making sure the correct version of JS libraries from the PHP vendor directory is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions