-
Notifications
You must be signed in to change notification settings - Fork 213
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
"MODULE_NOT_FOUND" if tailwind config is in another directory #124
Comments
The problem seems to be that something (either
|
Hey @saites. This is just how Node.js module resolution works:
The key thing here is that when using Here is your directory structure:
The
As you can see, neither of these directories exist so resolution fails and you get the error you are seeing. It's difficult to give specific recommendations without seeing your actual project, but in your minimal reproduction running |
Thanks, makes sense. I had a feeling this is a consequence of my unfamiliarity with My project uses a Rust server to render and serve Handlebars templates, so my only use of Node is to generate this CSS. As a consequence, the example in the repo isn't actually that different from how I'm using the CLI tool -- I'm running it in a Docker container with the relevant directories mounted, and hence, I had the config in a different directory than the original install. I think going forward, I'll probably just bake it into the image. Thanks again for the help, and the great work with Tailwind. |
What version of @tailwindcss/forms are you using?
v0.5.2
What version of Node.js are you using?
v18.6.0 (via the official
node:18
Docker image)What browser are you using?
N/A
What operating system are you using?
Debian Bullseye container, OpenSUSE host
Reproduction repository
https://github.com/saites/issue-tailwindcss-forms-non-local-config/
Describe your issue
If my config is not in the same directory, but specified with
--config
, this fails withCannot find module @tailwindcss/forms
. I don't know if this is an issue with the plugin or withtailwindcss
. See the example repo for a minimal example, which runs using Docker.The only difference between the working and failing example is that the failing example uses a non-local config file, whereas the working on uses a config file in the same directory:
The actual config files are identical (see the
Dockerfile
).Running
./works.sh
works:but
./fails.sh
fails withError: Cannot find module '@tailwindcss/forms'
:The text was updated successfully, but these errors were encountered: