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

JIT mode doesn't work with PostCSS stdin input #6894

Closed
nnooney opened this issue Jan 5, 2022 · 8 comments · Fixed by #6901
Closed

JIT mode doesn't work with PostCSS stdin input #6894

nnooney opened this issue Jan 5, 2022 · 8 comments · Fixed by #6901
Assignees

Comments

@nnooney
Copy link

nnooney commented Jan 5, 2022

What version of Tailwind CSS are you using?

tailwindcss v3.0.10

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

postcss-cli 8.4.5

What version of Node.js are you using?

v14.18.2

What browser are you using?

N/A

What operating system are you using?

Linux, Debian 10 Buster
(Specifically the vscode Hugo dev container at https://github.com/microsoft/vscode-dev-containers/tree/main/containers/hugo)

Reproduction URL

https://github.com/nnooney/tailwind-jit-postcss-stdin-demo

Describe your issue

When I try to process the CSS file above using the following command invocation, the CSS fails to process and produces the following error message:

cat tailwind.css | npx --no-install postcss --config ./postcss.config.js
Error: ENOENT: no such file or directory, stat '/workspaces/tailwind-jit-postcss-stdin-demo/stdin'
    at Object.statSync (fs.js:1131:3)
    at trackModified (/workspaces/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/lib/setupContextUtils.js:470:39)
    at Object.getContext (/workspaces/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/lib/setupContextUtils.js:822:5)
    at /workspaces/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:142:53
    at /workspaces/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/processTailwindFeatures.js:38:11
    at plugins (/workspaces/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/index.js:20:104)
    at LazyResult.runOnRoot (/workspaces/tailwind-jit-postcss-stdin-demo/node_modules/postcss/lib/lazy-result.js:339:16)
    at LazyResult.runAsync (/workspaces/tailwind-jit-postcss-stdin-demo/node_modules/postcss/lib/lazy-result.js:393:26)
    at LazyResult.async (/workspaces/tailwind-jit-postcss-stdin-demo/node_modules/postcss/lib/lazy-result.js:221:30)
    at LazyResult.then (/workspaces/tailwind-jit-postcss-stdin-demo/node_modules/postcss/lib/lazy-result.js:206:17) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/workspaces/tailwind-jit-postcss-stdin-demo/stdin'
}

This seems to be the same error message that occurred in #3944, which was resolved by modifying the PostCSS invocation to not use stdin. However, in my case, Hugo dynamically assembles the CSS from multiple files across its module system and passes the result to PostCSS.

Is the recommended way forward here to write output to a temporary file and then pass that file to PostCSS so that Tailwind's JIT can properly track it?

@nnooney
Copy link
Author

nnooney commented Jan 5, 2022

postcss-cli passes the current directory + stdin as the name of the file to PostCSS here: https://github.com/postcss/postcss-cli/blob/master/index.js#L226. This is where the path in the error message originates.

@RobinMalfait RobinMalfait self-assigned this Jan 5, 2022
@RobinMalfait
Copy link
Contributor

Hey! Thank you for your bug report!
Much appreciated! 🙏

I'll get this fixed, in the meantime you can also use the Tailwind CLI directly if you want to read from stdin:

cat tailwind.css | npx tailwindcss -i -

I'll come back to this issue once it is fixed. Thanks for the reproduction!

@RobinMalfait
Copy link
Contributor

This should be fixed (#6901), and will be available in the next release (probably later today).

You can already try it by using the insiders build npm install tailwindcss@insiders or yarn add tailwindcss@insiders.

@nnooney
Copy link
Author

nnooney commented Jan 6, 2022

Wow thank you for the incredibly quick bug fix and release! I can confirm that v3.0.11 does fix this issue.

Thank you again!

@istr
Copy link

istr commented Jan 19, 2022

@nnooney I am really curious how this fixes the issue for you.
https://github.com/nnooney/tailwind-jit-postcss-stdin-demo still fails for me when I bump the version to 3.0.15 there.
I get this:

git remote -v ; git --no-pager diff package.json ; npm list ; npm test
origin	https://github.com/nnooney/tailwind-jit-postcss-stdin-demo.git (fetch)
origin	https://github.com/nnooney/tailwind-jit-postcss-stdin-demo.git (push)
diff --git a/package.json b/package.json
index c47347e..ade1517 100644
--- a/package.json
+++ b/package.json
@@ -12,6 +12,6 @@
     "autoprefixer": "^10.4.1",
     "postcss": "^8.4.5",
     "postcss-cli": "^9.1.0",
-    "tailwindcss": "^3.0.10"
+    "tailwindcss": "^3.0.11"
   }
 }
tailwind-jit-postcss-stdin-demo@1.0.0 /home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo
├── autoprefixer@10.4.1
├── postcss-cli@9.1.0
├── postcss@8.4.5
└── tailwindcss@3.0.15


> tailwind-jit-postcss-stdin-demo@1.0.0 test
> cat tailwind.css | npx --no-install postcss --config ./postcss.config.js

Error: ENOENT: no such file or directory, stat '/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/stdin'
    at Object.statSync (fs.js:1016:3)
    at trackModified (/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/lib/setupContextUtils.js:463:46)
    at Object.getContext (/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/lib/setupContextUtils.js:818:5)
    at /home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:142:53
    at /home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/processTailwindFeatures.js:41:11
    at plugins (/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/tailwindcss/lib/index.js:20:104)
    at LazyResult.runOnRoot (/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/postcss/lib/lazy-result.js:339:16)
    at LazyResult.runAsync (/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/postcss/lib/lazy-result.js:393:26)
    at LazyResult.async (/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/postcss/lib/lazy-result.js:221:30)
    at LazyResult.then (/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/node_modules/postcss/lib/lazy-result.js:206:17) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo/stdin'
}

@nnooney
Copy link
Author

nnooney commented Jan 20, 2022

That's very strange; when I clone the same repository and update/test, I get CSS output printed to the console:

npm list
node ➜ /workspaces/tailwind-jit-postcss-stdin-demo (main ✗) $ npm list
tailwind-jit-postcss-stdin-demo@1.0.0 /workspaces/tailwind-jit-postcss-stdin-demo
├─┬ autoprefixer@10.4.2
│ ├─┬ browserslist@4.19.1
│ │ ├── caniuse-lite@1.0.30001300 deduped
│ │ ├── electron-to-chromium@1.4.49
│ │ ├── escalade@3.1.1
│ │ ├── node-releases@2.0.1
│ │ └── picocolors@1.0.0 deduped
│ ├── caniuse-lite@1.0.30001300
│ ├── fraction.js@4.1.2
│ ├── normalize-range@0.1.2
│ ├── picocolors@1.0.0
│ └── postcss-value-parser@4.2.0
├─┬ postcss@8.4.5
│ ├── nanoid@3.1.30
│ ├── picocolors@1.0.0 deduped
│ └── source-map-js@1.0.1
├─┬ postcss-cli@9.1.0
│ ├─┬ chokidar@3.5.2
│ │ ├─┬ anymatch@3.1.2
│ │ │ ├── normalize-path@3.0.0 deduped
│ │ │ └── picomatch@2.3.1
│ │ ├─┬ braces@3.0.2
│ │ │ └─┬ fill-range@7.0.1
│ │ │   └─┬ to-regex-range@5.0.1
│ │ │     └── is-number@7.0.0
│ │ ├── UNMET OPTIONAL DEPENDENCY fsevents@2.3.2
│ │ ├─┬ glob-parent@5.1.2
│ │ │ └── is-glob@4.0.3 deduped
│ │ ├─┬ is-binary-path@2.1.0
│ │ │ └── binary-extensions@2.2.0
│ │ ├── is-glob@4.0.3 deduped
│ │ ├── normalize-path@3.0.0 deduped
│ │ └─┬ readdirp@3.6.0
│ │   └── picomatch@2.3.1 deduped
│ ├── dependency-graph@0.11.0
│ ├─┬ fs-extra@10.0.0
│ │ ├── graceful-fs@4.2.9
│ │ ├─┬ jsonfile@6.1.0
│ │ │ ├── graceful-fs@4.2.9 deduped
│ │ │ └── universalify@2.0.0 deduped
│ │ └── universalify@2.0.0
│ ├── get-stdin@9.0.0
│ ├─┬ globby@12.0.2
│ │ ├── array-union@3.0.1
│ │ ├─┬ dir-glob@3.0.1
│ │ │ └── path-type@4.0.0 deduped
│ │ ├── fast-glob@3.2.7 deduped
│ │ ├── ignore@5.2.0
│ │ ├── merge2@1.4.1
│ │ └── slash@4.0.0 deduped
│ ├── picocolors@1.0.0 deduped
│ ├─┬ postcss-load-config@3.1.1
│ │ ├── lilconfig@2.0.4
│ │ └── yaml@1.10.2
│ ├─┬ postcss-reporter@7.0.5
│ │ ├── picocolors@1.0.0 deduped
│ │ └── thenby@1.3.4
│ ├── pretty-hrtime@1.0.3
│ ├─┬ read-cache@1.0.0
│ │ └── pify@2.3.0
│ ├── slash@4.0.0
│ └─┬ yargs@17.3.1
│   ├─┬ cliui@7.0.4
│   │ ├── string-width@4.2.3 deduped
│   │ ├─┬ strip-ansi@6.0.1
│   │ │ └── ansi-regex@5.0.1
│   │ └─┬ wrap-ansi@7.0.0
│   │   ├── ansi-styles@4.3.0 deduped
│   │   ├── string-width@4.2.3 deduped
│   │   └── strip-ansi@6.0.1 deduped
│   ├── escalade@3.1.1 deduped
│   ├── get-caller-file@2.0.5
│   ├── require-directory@2.1.1
│   ├─┬ string-width@4.2.3
│   │ ├── emoji-regex@8.0.0
│   │ ├── is-fullwidth-code-point@3.0.0
│   │ └── strip-ansi@6.0.1 deduped
│   ├── y18n@5.0.8
│   └── yargs-parser@21.0.0
└─┬ tailwindcss@3.0.15
  ├── arg@5.0.1
  ├─┬ chalk@4.1.2
  │ ├─┬ ansi-styles@4.3.0
  │ │ └─┬ color-convert@2.0.1
  │ │   └── color-name@1.1.4 deduped
  │ └─┬ supports-color@7.2.0
  │   └── has-flag@4.0.0
  ├── chokidar@3.5.2 deduped
  ├── color-name@1.1.4
  ├─┬ cosmiconfig@7.0.1
  │ ├── @types/parse-json@4.0.0
  │ ├─┬ import-fresh@3.3.0
  │ │ ├─┬ parent-module@1.0.1
  │ │ │ └── callsites@3.1.0
  │ │ └── resolve-from@4.0.0
  │ ├─┬ parse-json@5.2.0
  │ │ ├─┬ @babel/code-frame@7.16.7
  │ │ │ └─┬ @babel/highlight@7.16.10
  │ │ │   ├── @babel/helper-validator-identifier@7.16.7
  │ │ │   ├─┬ chalk@2.4.2
  │ │ │   │ ├─┬ ansi-styles@3.2.1
  │ │ │   │ │ └─┬ color-convert@1.9.3
  │ │ │   │ │   └── color-name@1.1.3
  │ │ │   │ ├── escape-string-regexp@1.0.5
  │ │ │   │ └─┬ supports-color@5.5.0
  │ │ │   │   └── has-flag@3.0.0
  │ │ │   └── js-tokens@4.0.0
  │ │ ├─┬ error-ex@1.3.2
  │ │ │ └── is-arrayish@0.2.1
  │ │ ├── json-parse-even-better-errors@2.3.1
  │ │ └── lines-and-columns@1.2.4
  │ ├── path-type@4.0.0
  │ └── yaml@1.10.2 deduped
  ├─┬ detective@5.2.0
  │ ├─┬ acorn-node@1.8.2
  │ │ ├── acorn@7.4.1
  │ │ ├── acorn-walk@7.2.0
  │ │ └── xtend@4.0.2
  │ ├── defined@1.0.0
  │ └── minimist@1.2.5
  ├── didyoumean@1.2.2
  ├── dlv@1.1.3
  ├─┬ fast-glob@3.2.7
  │ ├── @nodelib/fs.stat@2.0.5
  │ ├─┬ @nodelib/fs.walk@1.2.8
  │ │ ├─┬ @nodelib/fs.scandir@2.1.5
  │ │ │ ├── @nodelib/fs.stat@2.0.5 deduped
  │ │ │ └─┬ run-parallel@1.2.0
  │ │ │   └── queue-microtask@1.2.3
  │ │ └─┬ fastq@1.13.0
  │ │   └── reusify@1.0.4
  │ ├── glob-parent@5.1.2 deduped
  │ ├── merge2@1.4.1 deduped
  │ └─┬ micromatch@4.0.4
  │   ├── braces@3.0.2 deduped
  │   └── picomatch@2.3.1 deduped
  ├─┬ glob-parent@6.0.2
  │ └── is-glob@4.0.3 deduped
  ├─┬ is-glob@4.0.3
  │ └── is-extglob@2.1.1
  ├── normalize-path@3.0.0
  ├── object-hash@2.2.0
  ├─┬ postcss-js@4.0.0
  │ └── camelcase-css@2.0.1
  ├── postcss-load-config@3.1.1 deduped
  ├─┬ postcss-nested@5.0.6
  │ └── postcss-selector-parser@6.0.8 deduped
  ├─┬ postcss-selector-parser@6.0.8
  │ ├── cssesc@3.0.0
  │ └── util-deprecate@1.0.2
  ├── postcss-value-parser@4.2.0 deduped
  ├── quick-lru@5.1.1
  └─┬ resolve@1.21.0
    ├─┬ is-core-module@2.8.1
    │ └─┬ has@1.0.3
    │   └── function-bind@1.1.1
    ├── path-parse@1.0.7
    └── supports-preserve-symlinks-flag@1.0.0
npm test
node ➜ /workspaces/tailwind-jit-postcss-stdin-demo (main ✗) $ npm test

> tailwind-jit-postcss-stdin-demo@1.0.0 test /workspaces/tailwind-jit-postcss-stdin-demo
> cat tailwind.css | npx --no-install postcss --config ./postcss.config.js


warn - No utilities were generated there is likely a problem with the `content` key in the tailwind config. For more information see the documentation: https://tailwindcss.com/docs/content-configuration
/*
! tailwindcss v3.0.15 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
*/

html {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
     tab-size: 4; /* 3 */
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font family by default.
2. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input:-ms-input-placeholder, textarea:-ms-input-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/*
Ensure the default browser behavior of the `hidden` attribute.
*/

[hidden] {
  display: none;
}

*, ::before, ::after {
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
}
git --no-pager diff
node ➜ /workspaces/tailwind-jit-postcss-stdin-demo (main ✗) $ git --no-pager diff
diff --git a/package-lock.json b/package-lock.json
index b55d362..e496720 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -20,9 +20,9 @@
       "dev": true
     },
     "@babel/highlight": {
-      "version": "7.16.7",
-      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz",
-      "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==",
+      "version": "7.16.10",
+      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz",
+      "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==",
       "dev": true,
       "requires": {
         "@babel/helper-validator-identifier": "^7.16.7",
@@ -175,13 +175,13 @@
       "dev": true
     },
     "autoprefixer": {
-      "version": "10.4.1",
-      "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.1.tgz",
-      "integrity": "sha512-B3ZEG7wtzXDRCEFsan7HmR2AeNsxdJB0+sEC0Hc5/c2NbhJqPwuZm+tn233GBVw82L+6CtD6IPSfVruwKjfV3A==",
+      "version": "10.4.2",
+      "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.2.tgz",
+      "integrity": "sha512-9fOPpHKuDW1w/0EKfRmVnxTDt8166MAnLI3mgZ1JCnhNtYWxcJ6Ud5CO/AVOZi/AvFa8DY9RTy3h3+tFBlrrdQ==",
       "dev": true,
       "requires": {
         "browserslist": "^4.19.1",
-        "caniuse-lite": "^1.0.30001294",
+        "caniuse-lite": "^1.0.30001297",
         "fraction.js": "^4.1.2",
         "normalize-range": "^0.1.2",
         "picocolors": "^1.0.0",
@@ -229,9 +229,9 @@
       "dev": true
     },
     "caniuse-lite": {
-      "version": "1.0.30001296",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001296.tgz",
-      "integrity": "sha512-WfrtPEoNSoeATDlf4y3QvkwiELl9GyPLISV5GejTbbQRtQx4LhsXmc9IQ6XCL2d7UxCyEzToEZNMeqR79OUw8Q==",
+      "version": "1.0.30001300",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001300.tgz",
+      "integrity": "sha512-cVjiJHWGcNlJi8TZVKNMnvMid3Z3TTdDHmLDzlOdIiZq138Exvo0G+G0wTdVYolxKb4AYwC+38pxodiInVtJSA==",
       "dev": true
     },
     "chalk": {
@@ -350,9 +350,9 @@
       "dev": true
     },
     "electron-to-chromium": {
-      "version": "1.4.35",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.35.tgz",
-      "integrity": "sha512-wzTOMh6HGFWeALMI3bif0mzgRrVGyP1BdFRx7IvWukFrSC5QVQELENuy+Fm2dCrAdQH9T3nuqr07n94nPDFBWA==",
+      "version": "1.4.49",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.49.tgz",
+      "integrity": "sha512-k/0t1TRfonHIp8TJKfjBu2cKj8MqYTiEpOhci+q7CVEE5xnCQnx1pTa+V8b/sdhe4S3PR4p4iceEQWhGrKQORQ==",
       "dev": true
     },
     "emoji-regex": {
@@ -531,9 +531,9 @@
       }
     },
     "is-core-module": {
-      "version": "2.8.0",
-      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
-      "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
+      "version": "2.8.1",
+      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz",
+      "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==",
       "dev": true,
       "requires": {
         "has": "^1.0.3"
@@ -735,13 +735,12 @@
       }
     },
     "postcss-js": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-3.0.3.tgz",
-      "integrity": "sha512-gWnoWQXKFw65Hk/mi2+WTQTHdPD5UJdDXZmX073EY/B3BWnYjO4F4t0VneTCnCGQ5E5GsCdMkzPaTXwl3r5dJw==",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.0.tgz",
+      "integrity": "sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==",
       "dev": true,
       "requires": {
-        "camelcase-css": "^2.0.1",
-        "postcss": "^8.1.6"
+        "camelcase-css": "^2.0.1"
       }
     },
     "postcss-load-config": {
@@ -911,9 +910,9 @@
       "dev": true
     },
     "tailwindcss": {
-      "version": "3.0.10",
-      "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.0.10.tgz",
-      "integrity": "sha512-dSKGNqI6hyzY8CPX0GsYTZ9yTxGesHrNFPIANTBe8bQWNHGTsAd7PoZQ+HTaIQb/we3zaZfa4F487WCCvhBGbw==",
+      "version": "3.0.15",
+      "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.0.15.tgz",
+      "integrity": "sha512-bT2iy7FtjwgsXik4ZoJnHXR+SRCiGR1W95fVqpLZebr64m4ahwUwRbIAc5w5+2fzr1YF4Ct2eI7dojMRRl8sVQ==",
       "dev": true,
       "requires": {
         "arg": "^5.0.1",
@@ -929,13 +928,13 @@
         "is-glob": "^4.0.3",
         "normalize-path": "^3.0.0",
         "object-hash": "^2.2.0",
-        "postcss-js": "^3.0.3",
+        "postcss-js": "^4.0.0",
         "postcss-load-config": "^3.1.0",
         "postcss-nested": "5.0.6",
-        "postcss-selector-parser": "^6.0.7",
+        "postcss-selector-parser": "^6.0.8",
         "postcss-value-parser": "^4.2.0",
         "quick-lru": "^5.1.1",
-        "resolve": "^1.20.0"
+        "resolve": "^1.21.0"
       },
       "dependencies": {
         "glob-parent": {
diff --git a/package.json b/package.json
index c47347e..79825a2 100644
--- a/package.json
+++ b/package.json
@@ -9,9 +9,9 @@
   "author": "",
   "license": "MIT",
   "devDependencies": {
-    "autoprefixer": "^10.4.1",
+    "autoprefixer": "^10.4.2",
     "postcss": "^8.4.5",
     "postcss-cli": "^9.1.0",
-    "tailwindcss": "^3.0.10"
+    "tailwindcss": "^3.0.15"
   }
 }

My development environment is the Hugo vscode community dev container; perhaps there is something else that is different between our environments. What version of node are you using?

node ➜ /workspaces/tailwind-jit-postcss-stdin-demo (main ✗) $ node --version
v14.18.2

The fix in the linked Pull Request sets the throwIfNoEntry option on node's fs.statSync, which is present beginning in node 14.

v13.x docs, no throwIfNoEntry option: https://nodejs.org/docs/latest-v13.x/api/fs.html#fs_fs_statsync_path_options
v14.x docs, has throwIfNoEntry option: https://nodejs.org/docs/latest-v14.x/api/fs.html#fs_fs_statsync_path_options

@istr
Copy link

istr commented Jan 20, 2022

The fix in the linked Pull Request sets the throwIfNoEntry option on node's fs.statSync, which is present beginning in node 14.

There you go. Then the fix is kind of incomplete (at least until 2022-04-30: https://nodejs.org/en/about/releases/).
I will upgrade node and try again. Thanks a lot for pointing it out.

node --version
v12.22.7

apt-cache policy nodejs
nodejs:
  Installed: 12.22.7~dfsg-2
  Candidate: 12.22.7~dfsg-2

@istr
Copy link

istr commented Jan 20, 2022

Confirmed to work with node 16.13.2

git remote -v ; git --no-pager diff package.json ; node -v ; npm list ; npm test | head
origin	https://github.com/nnooney/tailwind-jit-postcss-stdin-demo.git (fetch)
origin	https://github.com/nnooney/tailwind-jit-postcss-stdin-demo.git (push)
diff --git a/package.json b/package.json
index c47347e..e272af3 100644
--- a/package.json
+++ b/package.json
@@ -9,9 +9,9 @@
   "author": "",
   "license": "MIT",
   "devDependencies": {
-    "autoprefixer": "^10.4.1",
+    "autoprefixer": "^10.4.2",
     "postcss": "^8.4.5",
     "postcss-cli": "^9.1.0",
-    "tailwindcss": "^3.0.10"
+    "tailwindcss": "^3.0.11"
   }
 }
v16.13.2
tailwind-jit-postcss-stdin-demo@1.0.0 /home/istr/hugo-playground/htw/tailwind-jit-postcss-stdin-demo
├── autoprefixer@10.4.2
├── postcss-cli@9.1.0
├── postcss@8.4.5
└── tailwindcss@3.0.15


> tailwind-jit-postcss-stdin-demo@1.0.0 test
> cat tailwind.css | npx --no-install postcss --config ./postcss.config.js


warn - No utilities were generated there is likely a problem with the `content` key in the tailwind config. For more information see the documentation: https://tailwindcss.com/docs/content-configuration
/*
! tailwindcss v3.0.15 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

istr referenced this issue in nnooney/tailwind-jit-postcss-stdin-demo Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants