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

Standalone CLI build fails with first-party plugin in config #12374

Closed
shoutbc opened this issue Nov 7, 2023 · 2 comments · Fixed by #12506
Closed

Standalone CLI build fails with first-party plugin in config #12374

shoutbc opened this issue Nov 7, 2023 · 2 comments · Fixed by #12506
Assignees

Comments

@shoutbc
Copy link

shoutbc commented Nov 7, 2023

What version of Tailwind CSS are you using?

tailwindcss v3.3.5

What build tool (or framework if it abstracts the build tool) are you using?

Standalone CLI (https://tailwindcss.com/blog/standalone-cli)

What version of Node.js are you using?

N/A

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction URL

Not Needed

Describe your issue

Standalone CLI throws error after adding first party plugin to the config (@tailwindcss/forms).

Config:
/** @type {import('tailwindcss').Config} */

module.exports = {
content: [
"../resources/**/*.blade.php",
],
plugins: [
require('@tailwindcss/forms'),
]
}

Error:
Rebuilding...
Error: Cannot find module '@tailwindcss/forms'
Require /public/tailwind.config.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
at _resolve (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:250334)
at jiti (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:252917)
at /home/eduquiz-5wyxc/staging.eduquiz.ca/public/tailwind.config.js:8:5
at evalModule (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:255614)
at jiti (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:253542)
at /snapshot/tailwindcss/lib/lib/load-config.js:37:30
at loadConfig (/snapshot/tailwindcss/lib/lib/load-config.js:39:6) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/[website]/public/tailwind.config.js'
]
}

@thecrypticace thecrypticace self-assigned this Nov 8, 2023
@thecrypticace
Copy link
Contributor

Notes for me tomorrow:

  • In a standard CJS config this works
  • If the config file is TypeScript, ESM, or otherwise has to be compiled by Jiti this error happens.

@thecrypticace
Copy link
Contributor

Hey I've merged the fix for this in #12506 and it'll be available in our next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants