duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/simple-commerce
Other
143 stars 34 forks source link

Error when visiting /cp on Windows 11 #1066

Open the-goodies opened 2 months ago

the-goodies commented 2 months ago

Description

I'm on Windows 11 and I get this error when I visit http://artisan-bakery.test/cp which was created from Simple Commerce starter kit: https://flareapp.io/share/B5ZvoYg5

Steps to reproduce

Visit newly created http://artisan-bakery.test/cp See error: https://flareapp.io/share/B5ZvoYg5

Environment

Environment Application Name: Statamic Laravel Version: 10.48.8 PHP Version: 8.3.6 Composer Version: 2.7.4 Environment: local Debug Mode: ENABLED URL: artisan-bakery.test Maintenance Mode: OFF

Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED

Drivers Broadcasting: log Cache: statamic Database: mysql Logs: stack / single Mail: smtp Queue: sync Session: file

Simple Commerce Currencies: GBP Gateways: Dummy Repository: Customer: DuncanMcClean\SimpleCommerce\Customers\EntryCustomerRepository Repository: Order: DuncanMcClean\SimpleCommerce\Orders\EntryOrderRepository Repository: Product: DuncanMcClean\SimpleCommerce\Products\EntryProductRepository Shipping Methods: Free Shipping Tax Engine: DuncanMcClean\SimpleCommerce\Tax\BasicTaxEngine

Statamic Addons: 1 Antlers: runtime Sites: 1 Stache Watcher: Enabled Static Caching: Disabled Version: 4.57.2 PRO

Statamic Addons duncanmcclean/simple-commerce: 6.2.0

duncanmcclean commented 2 months ago

Unfortunately, I'm not a Windows user so I can't reproduce this myself.

There was a similar issue in Statamic Core a few months ago, which got fixed in statamic/cms#9537. I'm not quite sure why that fix hasn't fixed the issue for SC, since orders live in the Stache. I'll need to have a think đŸ¤”

the-goodies commented 2 months ago

statamic new simple cd simple composer require duncanmcclean/simple-commerce php please sc:install

Visit simple.test/cp and it works. But since I can't create a new website from a starter kit (another issue: https://github.com/statamic/cms/issues/9967 ) can't test if issue still exists :)

the-goodies commented 2 months ago

Interesting, when I visit directly to: http://artisan-bakery.test/cp/collections/products it WORKS, but if I visit http://artisan-bakery.test/cp/ it redirects to http://artisan-bakery.test/cp/dashboard and I get this error.

duncanmcclean commented 2 months ago

Try removing any of the Simple Commerce widgets configured in config/simple-commerce.php.

the-goodies commented 2 months ago

config/statamic/cp.php:

    'widgets' => [
        // [
        //     'type' => 'orders_chart',
        //     'width' => 100,
        // ],
        // [
        //     'type' => 'recent_orders',
        //     'limit' => 5,
        //     'width' => 50,
        // ],
        [
            'type' => 'top_customers',
            'limit' => 5,
            'width' => 50,
        ],
        [
            'type' => 'low_stock_products',
            'limit' => 5,
            'width' => 50,
        ],
    ],

Now dashboard works, if I uncomment any of commented orders_chart or recent_orders, I get that error.