plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Bug]: Uknown view error for all views

Open smarkyun opened this issue 1 year ago • 25 comments

Bug description

The plugin cannot find any views. I tried invalidating the cache and reinstalling the plugin, but nothing changed.

image image

Plugin version

8.1.2.233

Operating system

Linux

Steps to reproduce

No response

Relevant log output

No response

smarkyun avatar Mar 04 '24 08:03 smarkyun

Hello. Could you check the Settings, Default view path and Default namespace parameters.

image

adelf avatar Mar 08 '24 05:03 adelf

image

smarkyun avatar Mar 08 '24 07:03 smarkyun

Please, it is very annoying

smarkyun avatar Mar 12 '24 09:03 smarkyun

Could you find all loadViewsFrom and addLocation calls(use Scope > All Places)?

image

You can disable this inspection for now.

image

adelf avatar Mar 12 '24 12:03 adelf

Yes, but the inspection is for all views not just those with custom namespace. Btw The inspection is not the main problem, I have to search for every view usage by name instead of just clicking the icon or using the hotkey

smarkyun avatar Mar 12 '24 14:03 smarkyun

Even the main view is unknown

smarkyun avatar Mar 12 '24 14:03 smarkyun

with custom namespace

Your view in the custom namespace? Did you set it in the settings?

image

adelf avatar Mar 12 '24 14:03 adelf

I meant the loadViewsFrom() 2. param is a namespace, but as I said, the plugin cannot recognize the simple view either

smarkyun avatar Mar 12 '24 14:03 smarkyun

If i install the legacy deprecated laravel plugin, it can recognize the views normally

smarkyun avatar Mar 12 '24 14:03 smarkyun

That's really weird. So you don't have any loadViewsFrom calls in the project? It has a default Laravel structure and the views aren't recognized?

adelf avatar Mar 12 '24 14:03 adelf

I do have image What I am saying is there are many view (like main.blade.php) calls without any namespace, and those are not working either.

smarkyun avatar Mar 12 '24 14:03 smarkyun

The views I am referring to are in the basic laravel structure resources/views folder

smarkyun avatar Mar 12 '24 14:03 smarkyun

does the plugin complete anything in the view('here') call?

adelf avatar Mar 12 '24 15:03 adelf

Yes, It seems only the ones from the loadViewsFrom call

smarkyun avatar Mar 12 '24 15:03 smarkyun

Can I provide you any additional information about the issue?

smarkyun avatar Mar 12 '24 15:03 smarkyun

I'm not sure. Could you send all .idea/laravel_* files? Here or [email protected]

adelf avatar Mar 12 '24 15:03 adelf

I fixed the issue. One of the loadViewsFrom call started with '../' instead of __DIR__ . '/'. It is still weird that this prevents the IDE from recognizing views.

smarkyun avatar Mar 13 '24 08:03 smarkyun

Is it in one of the packages or it was your loadViewsFrom?

Yes, my logic is that loadViewsFrom calls override the default settings, since there are a lot of package creators, who overrides the resources/views with own namespace views.

adelf avatar Mar 13 '24 12:03 adelf

It was mine

smarkyun avatar Mar 13 '24 15:03 smarkyun

Hello, I saw that you already solved your problem, but the solution you provided didn't work for me. I started looking in the settings and realized that putting a "/" before the views path also solves the problem. image image

RicardoAugustoTulio avatar May 10 '24 18:05 RicardoAugustoTulio

@RicardoAugustoTulio

Could you check your settings? Is Laravel directory empty?

image

adelf avatar May 12 '24 11:05 adelf

Hello, I saw that you already solved your problem, but the solution you provided didn't work for me. I started looking in the settings and realized that putting a "/" before the views path also solves the problem. image image

What the heck? This / just fixed my problem thought. But why do I have projects without the / prefix and it works?

flavius-constantin avatar Jul 12 '24 22:07 flavius-constantin

Can confirm putting a leading slash in default views path resolved it for me too.

ilkermutlu avatar Jul 16 '24 13:07 ilkermutlu

My suggestions were suddenly appended with other libraries, eg. <x-livewire-data-tables::select/> instead of <x-utils.select/>. Adding the / fixed this. This also happened about a month ago. Then I decided to reset PHPStorm. Glad to see there is a fix.

After this fix it still suggests the livewire paths after the correct paths btw. If I use the livewire paths I can click on them and they take me to the correct blade file.

image

timotee avatar Oct 24 '24 11:10 timotee

@timotee could you send your composer.lock(and .json if possible) to [email protected]?

And maybe some additional parts of the project(service providers, views, etc.). If it doesn't violate NDA.

adelf avatar Oct 24 '24 17:10 adelf

It's fixed. Thank you all for posting about the issue and sorry that it took so long to fix.

adelf avatar Dec 18 '24 10:12 adelf