Tailwind CSS automatic design tokens not working when run in pnpm
See original GitHub issueDescribe the bug
Tailwind CSS auto design tokens work fine when run in npm or yarn, but not in pnpm.
Error Details
$ pnpm story:dev
> repro-crach-use-pnpm-histoire@0.0.1 story:dev /workspace/repro-crach-use-pnpm-histoire
> histoire dev
➜ Local: http://127.0.0.1:6006/
➜ Network: use --host to expose
Collect stories start all
Error while collecting story /workspace/repro-crach-use-pnpm-histoire/node_modules/.histoire/plugins/builtin_tailwind-tokens/Tailwind.story.js:
Error: [vite-node] Failed to load @histoire/controls
at ViteNodeRunner.directRequest (file:///workspace/repro-crach-use-pnpm-histoire/node_modules/.pnpm/vite-node@0.22.1/node_modules/vite-node/dist/client.mjs:165:13)
at async ViteNodeRunner.cachedRequest (file:///workspace/repro-crach-use-pnpm-histoire/node_modules/.pnpm/vite-node@0.22.1/node_modules/vite-node/dist/client.mjs:113:12)
at async request (file:///workspace/repro-crach-use-pnpm-histoire/node_modules/.pnpm/vite-node@0.22.1/node_modules/vite-node/dist/client.mjs:136:16)
at async histoire/dist/node/vendors/controls.js:1:238
at async ViteNodeRunner.directRequest (file:///workspace/repro-crach-use-pnpm-histoire/node_modules/.pnpm/vite-node@0.22.1/node_modules/vite-node/dist/client.mjs:217:5)
at async ViteNodeRunner.cachedRequest (file:///workspace/repro-crach-use-pnpm-histoire/node_modules/.pnpm/vite-node@0.22.1/node_modules/vite-node/dist/client.mjs:113:12)
at async request (file:///workspace/repro-crach-use-pnpm-histoire/node_modules/.pnpm/vite-node@0.22.1/node_modules/vite-node/dist/client.mjs:136:16)
at async /workspace/repro-crach-use-pnpm-histoire/node_modules/.histoire/plugins/builtin_tailwind-tokens/Tailwind.story.js:7:31
at async ViteNodeRunner.directRequest (file:///workspace/repro-crach-use-pnpm-histoire/node_modules/.pnpm/vite-node@0.22.1/node_modules/vite-node/dist/client.mjs:217:5)
at async ViteNodeRunner.cachedRequest (file:///workspace/repro-crach-use-pnpm-histoire/node_modules/.pnpm/vite-node@0.22.1/node_modules/vite-node/dist/client.mjs:113:12)
Collect stories end 1335 ms
Message displayed on first startup after removing node_modules
$ pnpm story:dev
> repro-crach-use-pnpm-histoire@0.0.1 story:dev /workspace/repro-crach-use-pnpm-histoire
> histoire dev
(x2)
Forced re-optimization of dependencies
Failed to resolve dependency: flexsearch, present in 'optimizeDeps.include'
Failed to resolve dependency: shiki, present in 'optimizeDeps.include'
Failed to resolve dependency: vscode-oniguruma, present in 'optimizeDeps.include'
Failed to resolve dependency: vscode-textmate, present in 'optimizeDeps.include'
Using 8 threads for story collection
Collect stories start all
➜ Local: http://127.0.0.1:6006/
➜ Network: use --host to expose
src/lib/Counter.story.svelte 1959ms (setup:25ms, execute:24ms, run:1909ms)
Collect stories end 2529ms
Reproduction
https://github.com/oekazuma/repro-crach-use-pnpm-histoire
System Info
System:
OS: macOS 12.5.1
CPU: (8) arm64 Apple M1
Memory: 92.91 MB / 16.00 GB
Shell: 5.8.1 - /bin/zshx
Binaries:
Node: 16.15.0 - ~/Library/pnpm/node
Yarn: 1.22.18 - ~/Library/pnpm/yarn
npm: 8.5.5 - ~/Library/pnpm/npm
Browsers:
Chrome: 105.0.5195.102
Firefox: 103.0.1
Safari: 15.6.1
npmPackages:
@histoire/plugin-svelte: ^0.10.7 => 0.10.7
histoire: ^0.10.7 => 0.10.7
vite: ^3.1.0 => 3.1.0
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5
Top Results From Across the Web
Integrating Design Tokens With Tailwind - Michael Mangialardi
Tailwind effectively exposes utility classes that apply design tokens. Learn how to pair a design tokens pipeline with a Tailwind project.
Read more >Importing tokens from npm in Tailwind CSS config
It looks really powerful, but I'm having trouble using my design tokens within the config. I have my tokens distributed via npm, but...
Read more >create-design-tokens - npm Package Health Analysis - Snyk
Get a design tokens template based on Tailwind CSS default config. Usage. Run: npx create-design-tokens. create-design-tokens dependencies.
Read more >@aivenio/design-system - npm
We use Figma to design the system. The design tokens are controlled in a Figma page (see example page), which are synced automatically...
Read more >tokencss - GitHub
Token CSS is a new tool that seamlessly integrates Design Tokens into your development workflow. Conceptually, it is similar to tools like Tailwind, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@brunobely @oekazuma I have it working with pnpm.
Check it out on Stackblitz: https://stackblitz.com/edit/sveltejs-kit-template-default-fd1ka1?file=tailwind.config.cjs
⬇️ ⬇️ ⬇️
Couple things I had to do to get this working:
.npmrc
file (this appeared to get rid of some of the bugs in the console)3.2.4
and added other dependencies topackage.json
npx svelte-add@latest tailwindcss
tailwind.css
file and imported it in usinghistoire.setup.js
filehistoire.config.js
and handled everything invite.config.js
(not sure if this was needed or not)setupFile
invite.config.js
tailwind.config
Glad it worked out for you @oekazuma !