-
-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using pnpm: Error: Can't find stylesheet to import: @use '@material/theme/color-palette';
#348
Comments
I'm getting more or less the same error, and I'm using vanilla
The reason of the error seems to be that
So it seems like it's supposed to resolve this file correctly. How come it doesn't? Is there anything I can do to make this work properly, rather than having to install every dependency at the top level? |
This is very off-putting indeed. I even added |
I know it’s destructive, but my solution was to drop smui and directly use the material web components and css classes |
I did get errors previously but with "6.0.0-beta.13" when installation instructions are followed it works. Things that may not be intuitive or be missed glancing docs thinking they are just details:
Example project is a good starting point next to docs. |
True. It is a good point of reference. And it works with |
I can report the same thing.
|
Installing The real fix is to somehow find all installed |
I didn't really have the mental bandwidth to grok any of the above suggested fixes (I tried manually installing all the dependencies but it didn't work for me), so I just went back to NPM. I think this is probably the easiest and best workaround for now. |
and here is the list of command to install @Material packages, in my test:
|
I am copy pasting what @valeneiko wrote few comments up just to give a bit more visibility because some people seem to not read comments without big bold "workaround for pnpm" written in it. Current Workaround for PNPM
In other words, there is two steps you need to do to fix this issue until a proper fix is made in 1 : In your
|
Getting the same error with yarn |
For some reason, |
this is the update of command to install @Material packages, of course in my test.
|
Just pointing out in case someone opens this issue and scrolls all the way down here, installing all material packages can be avoided by using the workaround provided above. Obviously, installing all material packages would still work (with the command tweak too) but might be a hassle and result in a heavier package.json file, but to each their own. :) |
With
Because
|
I tried all of the solutions mentioned here without success. Using the https://pnpm.io/npmrc#shamefully-hoist
- "smui-theme-light": "smui-theme compile static/smui.css -i src/theme",
- "smui-theme-dark": "smui-theme compile static/smui-dark.css -i src/theme/dark"
+ "smui-theme-light": "smui-theme compile static/smui.css -i src/theme -i node_modules",
+ "smui-theme-dark": "smui-theme compile static/smui-dark.css -i src/theme/dark -i node_modules"
- public-hoist-pattern[]=@material/*
+ shamefully-hoist=true Delete With this solution, there is no need to install individual material components ( |
close #4 ## What are we doing with this PR? <!-- Describe the purpose of this PR --> Add [Svelte Material UI](https://sveltematerialui.com/) to the project as the main component library. Migrate the dummy auth UI from #7 to the new Material framework. ## Screenshots <!-- If applicable, add screenshots to help explain your changes -->   ## Notes to Reviewers <!-- Add any notes that you want to communicate to the reviewers --> > [!WARNING] > **Don't forget to `pnpm install`** ## Additional Information > [!IMPORTANT] > While the styles are already compiled inside `static/smui.css`, when you add a new SMUI component (i.e. doing `pnpm i -D @smui/button`) _**you must run `pnpm run prepare`**_ to re-compile the `src/theme/_smui-theme.scss` file. [source](https://sveltematerialui.com/SVELTEKIT.md) An issue [similar to this](hperrin/svelte-material-ui#348) was faced, it was fixed by this [following this comment's](hperrin/svelte-material-ui#348 (comment)) procedures. I was not able to replicate the error/success color for the status text whilst adhering to the theme, due to inability to access the theme colors inside the scripts. Hope this does not come up again in the future.
@use '@material/theme/color-palette';
@use '@material/theme/color-palette';
I am using svelteKit and I am trying to integrate with SMUI.
** problem **
I am getting an error when trying to compile the theme:
My
postcss.config.cjs
:** cause ***
I think the problem is with using PNPM as package manager, this fails:
path.dirname(require.resolve('@material/dom/package.json')),
Because of PNPMs linking style, this resolves to
/XXX/node_modules/.pnpm/@[email protected]/node_modules
** workaround **
Package.json:
I get past the error, but I have to install all
@material/
packages by hand.The text was updated successfully, but these errors were encountered: