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 error #4920

Closed
Aervyon opened this issue Jul 8, 2021 · 1 comment · Fixed by #5008
Closed

JIT Build error #4920

Aervyon opened this issue Jul 8, 2021 · 1 comment · Fixed by #5008

Comments

@Aervyon
Copy link

Aervyon commented Jul 8, 2021

What version of Tailwind CSS are you using?

V2.2.4

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

Nuxt 2.X

What version of Node.js are you using?

V14.16.0

What browser are you using?

N/A

What operating system are you using?

Windows, Linux (Ubuntu)

Reproduction repository

https://github.com/VoidNulll/tailwind-error

Describe your issue

With Tailwind JIT I am running into an issue of "file not found" during build with Nuxt. This error happens on Tailwind 2.2.x (not 2.1.x) when the directory has the word "null" in the name

Reproduction steps:

# Clone repo into a directory with the name "null" in the directory name
# cd to directory of cloned repo
$ npm install
$ npm run build

# Build fails and error appears here
# Switching from JIT to standard fixes error.
@tailwindlabs tailwindlabs deleted a comment from Nunez587 Jul 17, 2021
peteretelej added a commit to peteretelej/tailwindcss that referenced this issue Jul 18, 2021
The trackedModified call in the tracking logic has a bug that
incorrectly removes `null` from pathnames

Currently:
```
let pathname = parsed.href.replace(parsed.hash, '').replace(parsed.search, '')
```
Where if `parsed.hash` or `parsed.search` are missing (which is
mostly the case for FS files), the value is null
eg `{ hash: null, search: null}`
  - In which case, we essentially trim `null`
converting `/mypath/nulldir/file.js` -> `/mypath/dir/filejs` and
breaking builds (see tailwindlabs#4920 ).

Fix checks if `hash` or `search` are set before replacing them

Fixes tailwindlabs#4920
peteretelej added a commit to peteretelej/tailwindcss that referenced this issue Jul 18, 2021
The trackedModified call in the tracking logic has a bug that
incorrectly removes `null` from pathnames

Currently:
```
let pathname = parsed.href.replace(parsed.hash, '').replace(parsed.search, '')
```
Where if `parsed.hash` or `parsed.search` are missing (which is
mostly the case for FS files), the value is null
eg `{ hash: null, search: null}`
  - In which case, we essentially trim `null`
converting `/mypath/nulldir/file.js` -> `/mypath/dir/filejs` and
breaking builds (see tailwindlabs#4920 ).

Fix checks if `hash` or `search` are set before replacing them

Fixes tailwindlabs#4920
@peteretelej
Copy link
Contributor

null is being removed from the pathname by the file tracking
image

opening a PR with fix

RobinMalfait pushed a commit that referenced this issue Aug 27, 2021
The trackedModified call in the tracking logic has a bug that
incorrectly removes `null` from pathnames

Currently:
```
let pathname = parsed.href.replace(parsed.hash, '').replace(parsed.search, '')
```
Where if `parsed.hash` or `parsed.search` are missing (which is
mostly the case for FS files), the value is null
eg `{ hash: null, search: null}`
  - In which case, we essentially trim `null`
converting `/mypath/nulldir/file.js` -> `/mypath/dir/filejs` and
breaking builds (see #4920 ).

Fix checks if `hash` or `search` are set before replacing them

Fixes #4920
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