raziel79's avatar

material design textfield

Hi all, i have a fresh laravel fresh installation, i try to install @material/textfield:

npm install @material/textfield

import in my app.scss:

@use "@material/textfield";

@include textfield.core-styles;

compiling: npm run dev

but return this error:


ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
  ╷
2 │ @use "@material/textfield";
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^

Any ideas?

0 likes
3 replies
bobbybouwmann's avatar

You're importing the core-styles, but you also need to install the material UI core for that. Try this

npm install @material-ui/core
1 like
raziel79's avatar

thb bobby but won't work now new error:

ERROR in ./resources/sass/contact.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Invalid CSS after "@include textfield": expected 1 selector or at-rule, was ".core-styles;"
        on line 4 of /Users/davideminardi/Code/listenagency/listenagency/resources/sass/contact.scss
>> @include textfield.core-styles;

   ---------^
bobbybouwmann's avatar

I honestly have no idea what's going wrong here. You might be better of creating an issue on the repository on Github with your question. Someone else might know something.

Please or to participate in this conversation.