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

@create-figma-plugin/build doesn't work inside a pnpm workspace #84

Closed
gluck opened this issue Feb 10, 2022 · 7 comments
Closed

@create-figma-plugin/build doesn't work inside a pnpm workspace #84

gluck opened this issue Feb 10, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@gluck
Copy link

gluck commented Feb 10, 2022

When the plugin is part of a pnpm monorepo (using workspaces), it fails to find tcm.

Reason is that in that case tcm is present only in:
node_modules/@create-figma-plugin/build/node_modules/.bin/

And not in:
node_modules/.bin/

Fix:

  • use { cwd: __dirname } as findUp option (default is process.cwd())

Workaround:

  • install typed-css-modules in figma plugin so tcm binary gets installed in node_modules/.bin as well.
@yuanqing
Copy link
Owner

@gluck Can you confirm whether this issue is fixed by @create-figma-plugin/build@1.8.4-alpha.0?

@yuanqing
Copy link
Owner

The commit that should fix this issue is 96d1025

@yuanqing yuanqing added the bug Something isn't working label Feb 13, 2022
@gluck
Copy link
Author

gluck commented Feb 13, 2022

I haven't tested yet but afaict it won't fix it, this folder will only exist in cwd if the user installed it.

@yuanqing
Copy link
Owner

Got it. Just to check, is the repo set up that such that @create-figma-plugin/build is a root dependency only – ie. it is specified in ./package.json but not in ./packages/my-plugin/package.json?

@gluck
Copy link
Author

gluck commented Feb 13, 2022

The other way around.
But if you think about it, tcm being a node dependency, it should resolve it like node does, i.e. crawling folders up starting from __dirname.
Thinking about it, using require.resolve('...') (and finding the binary from there) should also work

@yuanqing
Copy link
Owner

Verified that this is fixed as of 1.8.4

@gluck
Copy link
Author

gluck commented Feb 14, 2022

Confirmed working on my side too, thx !

@gluck gluck closed this as completed Feb 14, 2022
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

2 participants