laravel / nova-issues

553 stars 34 forks source link

ExportAsCsv with Excel type selector not working on Vapor #6018

Closed Mihkel100 closed 11 months ago

Mihkel100 commented 11 months ago

On Vapor, ExportAsCsv only works with CSV. Locally, it works with both CSV and Excel.

public function actions(NovaRequest $request)
{
    return [
        (new ExportAsCsv())->withTypeSelector(),
    ];
}
crynobone commented 11 months ago

What doesn't work when you try it with Excel? Can you share any screenshots, return response data (using Browser Network history) etc?

Mihkel100 commented 11 months ago

What doesn't work when you try it with Excel? Can you share any screenshots, return response data (using Browser Network history) etc?

It works locally but not on Vapor. CSV export works on Vapor too.

Excel export seems to get 502 error when posting to https://<url>action?action=export-as-csv&pivotAction=false&search=&filters=W3siQXBwXFxOb3ZhXFxGaWx0ZXJzXFxCdXNpbmVzc1JlZ2lvblN0YWZmRmlsdGVyIjoiIn0seyJBcHBcXE5vdmFcXEZpbHRlcnNcXFNoaWZ0RmlsdGVyIjoiIn0seyJBcHBcXE5vdmFcXEZpbHRlcnNcXFN0YWZmUm9sZUZpbHRlciI6IldPUktFUiJ9XQ%3D%3D&trashed

crynobone commented 11 months ago

SmartSelect_20231106_162333_Chrome.png

are you sure it's not hitting any Laravel Vapor limitations such as above?

Mihkel100 commented 11 months ago

I don't think this is the case. It even happens when I try to export one row. When I export locally, the Excel file size is 8KB.

crynobone commented 11 months ago

It could be code related if the error code was 500, generic exception HTTP response from Laravel. But since it's 502 that indicate that's it either Laravel Vapor or the web server gateway returning the error.

Mihkel100 commented 11 months ago
HTTP/1.1 502 
content-type: application/json
content-length: 36
...
x-amzn-errortype: InternalServerErrorException
x-cache: Error from cloudfront
Mihkel100 commented 11 months ago

@crynobone Is there anything else I can do regarding this issue?

Mihkel100 commented 11 months ago

@crynobone please let me know the next steps.

davidhemphill commented 11 months ago

Unfortunately, we can't debug issues in your production environment using Nova. Since the error seems to be something caused by your Cloudfront configuration, it's not possible for us to really help there. Thanks!

Mihkel100 commented 11 months ago

Nothing custom. Haven't touched Cloudfront confuguration. Using gateway-version: 1.