wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 166 forks source link

Returning rendered blade component causes file_exists to fail on some systems #60

Closed Reex11 closed 2 years ago

Reex11 commented 2 years ago

Describe the bug I get this error on my production server ( and only on production )

file_exists(): File name is longer than the maximum allowed path length on this platform (4096): /var/www/vhosts/********************/resources/views/<div class="relative" x-data="{ localeDateConfig: {}, config: { interval: 10, is12H: true, readonly: false, disabled: false, }, withoutTimezone: false, timezone: 'UTC', userTimezone: '', ... As shown above, it seems like the view content is treated as a file name for some reason.

After digging around (for days) I found the exact same issue here and I found other packages which had and fixed the issue here.

I think and hope you can find better details about the issue in the provided links. Never the less, please let me know if you need further information about the issue.

PH7-Jack commented 2 years ago

Hello @Reex11 Thanks for your report! I will check to fix it.

What is your hosting platform? PHP version? When does it happen? when opening a modal, dialog, or when render the page?

Reex11 commented 2 years ago

Hi @PH7-Jack, Thank you for your reply.

Hosting OS: Ubuntu 18.04.5 LTS PHP Version: 7.4.22

The exception happens when the modal (while calling the modal containing the component).

To assure clear understanding: 1- The modal I'm using is from another package. 2- The issue happens when trying to call the datepicker component, and I don't know if there any issue with other components from this package.

hope the screenshots below are helpful:

image image

PH7-Jack commented 2 years ago

Can you give me a modal component name (the package name)? I will simulate this to fix it

Reex11 commented 2 years ago

This is it. https://github.com/livewire-ui I'll try and use wireUI model component and report back to you with the result.

Reex11 commented 2 years ago

Tried to use wireUI model and got the same result. Also tried to use it on a regular livewire component and got the same result as well.

I don't understand why the render function outcome is different in the production server.

Reex11 commented 2 years ago

Update: I tested my project locally on WSL2 and it worked as expected.

The issue is still present on the production server.

WSL2 Env: Ubuntu 20.04 | PHP 7.4 | Apache2

PH7-Jack commented 2 years ago

I'm refactoring the components to make them smaller and trying to solve this problem

Reex11 commented 2 years ago

You know better, But I dont think the issue is about the size of the components. I think its related to the behaviour of the code execution.

For some reason (the content of the component) is used as a (file name) to be called and this causes long file name calling error (for a file that doesn't even exist).

PH7-Jack commented 2 years ago

Yes, i'm looking to solve it soon. I paused the refactoration to resolve it

PH7-Jack commented 2 years ago

are you using the latest laravel and livewire versions?

Reex11 commented 2 years ago

Yes.

laravel v8.54.0 livewire v2.5.5

PH7-Jack commented 2 years ago

@Reex11 I tried in several ways to reproduce this error, but I couldn't, not even in a production environment. In the sent prints the file name is small, unlike the error log in the issue, I didn't get much result in the search for this error. Could you send me an email so we can better analyze this issue? Or send more information about it "file_exists(): File name is longer than the maximum allowed path length on this platform (4096):"

Reex11 commented 2 years ago

Sure, can u share your email? Or where can I find it.

PH7-Jack commented 2 years ago

Hey @Reex11 Can you try now using this WireUi version? https://github.com/PH7-Jack/wireui/tree/fix-large-file-name And this Laravel Framework version https://github.com/PH7-Jack/framework/tree/allow-attributes-before-render

Reex11 commented 2 years ago

Hi Pedro, Sorry I was quite busy and I couldn't find the time to try that. I'll try it tonight and report back to you.

Thank you for your help!

Reex11 commented 2 years ago

Hi @PH7-Jack, I've tested the versions and everything seems to be running smoothly now, Thank you! 🚀

PH7-Jack commented 2 years ago

Unfortunately, my PR was closed on laravel, so I can't do much to solve this laravel problem.

Reex11 commented 2 years ago

Ok, thanks for trying anyway. Your help is much appreciated.

jasha1974 commented 2 years ago

hi, same problem bellow :

[2021-11-04 13:37:23] production.ERROR: file_exists(): File name is longer than the maximum allowed path length on this platform (4096): /home/www/restaurant-cylindr.cz/www/test.restaurant-cylindr.cz/resources/views/<div x-data="wireui_datetime_picker({ model: window/Livewire/find('qKjnYIZFfxlJyfXKE4EL')/entangle('date')/defer,

thanx

Tiagospem commented 2 years ago

@jasha1974 @PH7-Jack @Reex11 I found a way to temporarily solve this issue. Go to your php settings and set open_basedir to none!

Reex11 commented 2 years ago

Hi @Tiagospem , Thank you for the tip! I'll try it and get back to you.

Reex11 commented 2 years ago

Hi @Tiagospem, Your fix is working! Thank you very much.

jasha1974 commented 2 years ago

great, got it, but ISP tell that off this directive is not secure. i don't know. anyway thanx a lot