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

Cannot find module when in monorepo/yarn workspace #61

Open
rtablada opened this issue Oct 23, 2018 · 6 comments
Open

Cannot find module when in monorepo/yarn workspace #61

rtablada opened this issue Oct 23, 2018 · 6 comments
Labels
Bug Something isn't working

Comments

@rtablada
Copy link

When creating a new project I found that there is an error

'tailwindcss/plugins/container' is imported by ../../../../../../var/folders/64/0sk2_z6n3js7b93cj47tlpxw0000gn/T/broccoli-90368eONv5LidytFA/cache-003-rollup/build/config/tailwind.js, but could not be resolved – treating it as an external dependency
Build Error (BuildTailwindPlugin)

Cannot find module 'tailwindcss/plugins/container'

This is a new application and the only issue I can find is that the project is in a yarn workspace instead of the root node project so paths are different.

This could be an issue with the build tree including relative paths to the project instead of doing a lookup to find the project/node_module root?

@rtablada
Copy link
Author

rtablada commented Oct 23, 2018

To recreate this this is the repo with the error shown: https://github.com/rtablada/upcoming-games/tree/tailwind

It is a pretty simple workspace project with a brand new ember application

@samselikoff
Copy link
Contributor

Yikes! Thanks for reporting

@samselikoff samselikoff added the Bug Something isn't working label Oct 24, 2018
@samselikoff
Copy link
Contributor

You might be able to get unstuck for now by commenting out this line and these lines in your default generated tailwind/config/tailwind.js config file

@rtablada
Copy link
Author

Will have to check this out. Looks like there are a few other addons that are impacted too :( so while there needs to be addon level fixes there may be a need for a helper function to find the node_modules directory since relative path is a common pattern in addons.

@timiyay
Copy link

timiyay commented May 23, 2019

We're starting to adopt ember-cli-tailwind, and are also trying to adopt Yarn workspaces, and have this issue.

Has the understanding of it changed since Oct 2018? We'll be investigating it sometime soon, so it'd be handy to hear any additional thoughts on causes and possible solutions.

@samselikoff
Copy link
Contributor

Not exactly but we do want to move to using ember-cli-postcss in the future. But we'll make sure folks can upgrade.

I haven't used yarn workspaces so I don't know the details there

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

3 participants