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 build broken on build where node temp folder drive is different from project drive #4043

Closed
void-mAlex opened this issue Apr 11, 2021 · 2 comments · Fixed by #4044
Closed

Comments

@void-mAlex
Copy link
Contributor

What version of Tailwind CSS are you using?

v2.1.1

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

postcss + ember-cli

What version of Node.js are you using?

14.15.4

What browser are you using?

N/A

What operating system are you using?

Windows

Reproduction repository

https://github.com/void-mAlex/tailwindcss_issue_reproduction

Describe your issue

Issue when building on windows when repository is on a different drive than node js temp folder

to see issue reproduction repository MUST be checked out on windows on a different drive than where nodejs is installed/running (for the purposes of this test I have been using d: drive - nodejs will use the user temp folder located on c: drive)

steps after cloning the repo:
npm ci
npm run build

the following error appears:

$ npm run build

> [email protected] build D:\dev\tailwindcss_issue_reproduction
> ember build --environment=production


Running without permission to symlink will degrade build performance.
See https://cli.emberjs.com/release/appendix/windows/ for details.

Environment: production
- building... [PostcssCompiler]
warn - You have enabled the JIT engine which is currently in preview.
warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
cleaning up...
Build Error (PostcssCompiler)

ENOENT: no such file or directory, stat '/Users/<username>/AppData/Local/Temp/broccoli-164808k3ehFsfMVgY/out-210-broccoli_merge_trees_full_application//app/styles/app.css'

to track down what was happening debugged the build pipeline and discovered the error was thrown from within

let pathname = url.parse(file).pathname
let newModified = fs.statSync(decodeURIComponent(pathname)).mtimeMs

the path from line 232 gets read as
/Users/<username>/AppData/Local/Temp/broccoli-164808k3ehFsfMVgY/out-210-broccoli_merge_trees_full_application//app/styles/app.css
instead of
c:/Users/<username>/AppData/Local/Temp/broccoli-164808k3ehFsfMVgY/out-210-broccoli_merge_trees_full_application//app/styles/app.css

this causes fs.statSync to call toNamespacedPath on the path making it point to
d:/Users/<username>/AppData/Local/Temp/broccoli-164808k3ehFsfMVgY/out-210-broccoli_merge_trees_full_application//app/styles/app.css
where the file rightfully doesn't exist and throws the error

using .href instead of .pathname resolves this issue

@void-mAlex
Copy link
Contributor Author

bump, is there anything else I can do to get this fixed?

adamwathan pushed a commit that referenced this issue May 7, 2021
* use href to get the full path of the file
fixes #4043

* drop query strings and document fragment from path
@adamwathan
Copy link
Member

Thanks this will be fixed in v2.2! Can use canary build in the mean time:

npm install -D tailwindcss@canary

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.

2 participants