Skip to content
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

Yarn support with Smui-Theme #639

Open
DavidArchibald opened this issue Nov 9, 2023 · 0 comments
Open

Yarn support with Smui-Theme #639

DavidArchibald opened this issue Nov 9, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@DavidArchibald
Copy link

Describe the bug
If you use Yarn and try to use smui-theme it'll error like so:

Compiling SMUI Styles...
/home/name/repoPath/.pnp.cjs:11831
      Error.captureStackTrace(firstError);
            ^

Error: smui-theme tried to access @material/dom, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: @material/dom (via "@material/dom/package.json")
Required by: smui-theme@npm:7.0.0-beta.15 (via /home/name/.yarn/berry/cache/smui-theme-npm-7.0.0-beta.15-72073d0652-10c0.zip/node_modules/smui-theme/bin/)

Require stack:
- /home/name/.yarn/berry/cache/smui-theme-npm-7.0.0-beta.15-72073d0652-10c0.zip/node_modules/smui-theme/bin/index.js
- /home/name/.yarn/berry/cache/smui-theme-npm-7.0.0-beta.15-72073d0652-10c0.zip/node_modules/smui-theme/smui-theme
    at require$$0.Module._resolveFilename (/home/name/repoPath/.pnp.cjs:11831:13)
    at Function.resolve (node:internal/modules/helpers:118:19)
    at Object.handler (/home/name/.yarn/berry/cache/smui-theme-npm-7.0.0-beta.15-72073d0652-10c0.zip/node_modules/smui-theme/bin/index.js:62:34)
    at /home/name/.yarn/berry/cache/yargs-npm-17.7.2-80b62638e1-10c0.zip/node_modules/yargs/build/index.cjs:1:8993
    at j (/home/name/.yarn/berry/cache/yargs-npm-17.7.2-80b62638e1-10c0.zip/node_modules/yargs/build/index.cjs:1:4956)
    at _.handleValidationAndGetResult (/home/name/.yarn/berry/cache/yargs-npm-17.7.2-80b62638e1-10c0.zip/node_modules/yargs/build/index.cjs:1:8962)
    at _.applyMiddlewareAndGetResult (/home/name/.yarn/berry/cache/yargs-npm-17.7.2-80b62638e1-10c0.zip/node_modules/yargs/build/index.cjs:1:9604)
    at _.runCommand (/home/name/.yarn/berry/cache/yargs-npm-17.7.2-80b62638e1-10c0.zip/node_modules/yargs/build/index.cjs:1:7231)
    at [runYargsParserAndExecuteCommands] (/home/name/.yarn/berry/cache/yargs-npm-17.7.2-80b62638e1-10c0.zip/node_modules/yargs/build/index.cjs:1:58539)
    at te.parse (/home/name/.yarn/berry/cache/yargs-npm-17.7.2-80b62638e1-10c0.zip/node_modules/yargs/build/index.cjs:1:40478)

Node.js v19.4.0

This leads back to this line:

path.dirname(require.resolve('@material/dom/package.json')),

Because @material/dom isn't declared as a dependency. I'd be completely willing to put in a PR to fix this but I'm filing an issue in case there's something I'm missing about how the package is supposed to work. It seems like even once this dependency issue is fixed there's another one right after.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new folder and open a terminal in it.
  2. Run yarn init (you can leave the defaults).
  3. Run yarn add -D smui-theme
  4. Run mkdir static
  5. Run yarn run smui-theme compile static/smui.css -i src/theme

This issue of course persists in a more completely set up project with an actual theme in src/theme etc.

Expected behavior

For the command not to error.

@DavidArchibald DavidArchibald added the bug Something isn't working label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant