simple-commerce icon indicating copy to clipboard operation
simple-commerce copied to clipboard

Error when visiting /cp on Windows 11

Open the-goodies opened this issue 1 year ago • 5 comments

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

the-goodies avatar Apr 26 '24 21:04 the-goodies

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 🤔

duncanmcclean avatar Apr 27 '24 11:04 duncanmcclean

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 avatar Apr 27 '24 11:04 the-goodies

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.

the-goodies avatar Apr 27 '24 11:04 the-goodies

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

duncanmcclean avatar Apr 27 '24 12:04 duncanmcclean

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.

the-goodies avatar Apr 27 '24 12:04 the-goodies

This will be fixed by the next major version of Simple Commerce (I don't have an ETA for that, unfortunetley).

In the meantime, you can either switch to storing orders in a database or keep those widgets disabled.

duncanmcclean avatar Aug 05 '24 11:08 duncanmcclean