wireui / wireui

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

Select component icon error #40

Closed carloslopes34 closed 2 years ago

carloslopes34 commented 2 years ago

When adding the component select in a livewire view, it returns this error: Typed property WireUi\View\Components\Icon::$style must be string, null used (View: C:\xampp\htdocs\Projetos\teste.com.br\resources\views\vendor\wireui\components\select.blade.php). Unknown Property Did you mean WireUi\View\Components\Icon::$style ?

<x-select
    label="Select Relator"
    placeholder="Select relator"
    wire:model.defer="model"
>
    <x-select.user-option img="https://via.placeholder.com/500" label="People 1" value="1" />
    <x-select.user-option img="https://via.placeholder.com/500" label="People 2" value="2" />
    <x-select.user-option img="https://via.placeholder.com/500" label="People 3" value="3" />
    <x-select.user-option img="https://via.placeholder.com/500" label="People 4" value="4" />
</x-select>
PH7-Jack commented 2 years ago

Hello @carloslopes34

You was published the wireui config file? Was changed the WIREUI_ICONS_STYLE?

carloslopes34 commented 2 years ago

Hello @PH7-Jack I published as the installation exemplifies, and I didn't change anything, I just inserted the select component of the example to start testing it but it returns this Icon error. I'm using laravel 8 + livewire in my project.

PH7-Jack commented 2 years ago

Can you check it? your-project/config/wireui.php image

or check this WIREUI_ICONS_STYLE in .env file

carloslopes34 commented 2 years ago

it's exactly the same, I don't add it to the .env. I published these files, which path are they located in? do i need to install the separate icons?

php artisan vendor:publish --tag='wireui.config' php artisan vendor:publish --tag='wireui.resources' php artisan vendor:publish --tag='wireui.lang'

PH7-Jack commented 2 years ago

You can create a reproducible repository with this error? I try here, but nothing happen

When you publish files, will be found in: your-project/config/wireui.php your-project/resources/lang/vendor/wireui/ your-project/resources/views/vendor/wireui/

PH7-Jack commented 2 years ago

Don't need to install any icons

carloslopes34 commented 2 years ago

as it is an internal project of the company I cannot publish it, but it has something to do with the x-icon components, doing some testing, i realize that only components that use icons cause this error.

PH7-Jack commented 2 years ago

You don't need to publish your project, you can create a new project and simulate this same error

carloslopes34 commented 2 years ago

realizei uma instalação de laravel 8 + jetstream e livewire , adcionei tailwindcss , para teste e ocorre mesmo erro... há algo que poderia causar algum conflito com o icones?

Essas são minhas dependencias de npm "devDependencies": { "@tailwindcss/forms": "^0.3.1", "@tailwindcss/typography": "^0.4.0", "alpinejs": "^2.7.3", "axios": "^0.21", "laravel-mix": "^6.0.25", "lodash": "^4.17.19", "postcss": "^8.3.5", "resolve-url-loader": "^3.1.4", "sass": "^1.35.1", "sass-loader": "^12.1.0", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.4", "webpack": "^5.41.1" }, "dependencies": { "postcss-import": "^14.0.1", "sweetalert2": "^11.0.18" }

e estas a de composer

"require": { "php": "^7.3|^8.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^8.40", "laravel/jetstream": "^2.3", "laravel/sanctum": "^2.6", "laravel/tinker": "^2.5", "laravel/ui": "^3.3", "livewire/livewire": "^2.0", "ph7jack/wireui": "^0.9.2", "spatie/laravel-permission": "^4.2" }, "require-dev": { "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^5.0", "phpunit/phpunit": "^9.3.3" },

carloslopes34 commented 2 years ago

Testando uma instalação nova do laravel 8 + jetstream + livewire + tailwindcss o erro retornado é diferente. Undefined variable: _instance (View: C:\xampp\htdocs\Projetos\Pessoais\teste\resources\views\vendor\wireui\components\select.blade.php) há algo conflitando com esta instalação.

PH7-Jack commented 2 years ago

I create an example repository using jetstream and wireui https://github.com/PH7-Jack/wireui-jetstream-starter-kit

The error Undefined variable: _instance is because you are imporrting select component outside a livewire component

carloslopes34 commented 2 years ago

No projeto teste funciona mas no projeto que estou usando e instalei esse pacote ele continua com erro de icone. Alguma ideia ou sugestão que possa me dar?

Typed property WireUi\View\Components\Icon::$style must be string, null

PH7-Jack commented 2 years ago

Try: php artisan clear && php artisan view:clear && php artisan config:clear && php artisan cache:clear Verify if you have an "x-icon" component in your project and remove it Remove published wireui assets and config, and publish again if you needed

carloslopes34 commented 2 years ago

@PH7-Jack funcionou perfeitamente !!!! Tinha algo a ver com o cache do laravel . Incrivel pacote de componentes . Muito Obrigado pela Ajuda Amigo!!!!

PH7-Jack commented 2 years ago

Thanks, enjoy wireui