Skip to content

Commit

Permalink
fix: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Nov 23, 2024
1 parent 6737752 commit a46d535
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .changeset/hot-owls-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'hot-hook': patch
---

See https://github.com/tailwindlabs/tailwindcss/discussions/15105

Sometimes in the resolve hook, we receive a parentUrl that is just `data:`. I didn't really understand
why yet, for now we just ignore these cases and that seems to fix the issue with Tailwind V4.

8 changes: 8 additions & 0 deletions packages/hot_hook/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ export class HotHookLoader {
this.#initialize(resultPath)
return result
} else {
/**
* Sometimes we receive a parentUrl that is just `data:`. I didn't really understand
* why yet, for now we just ignore these cases.
*
* See https://github.com/tailwindlabs/tailwindcss/discussions/15105
*/
if (parentUrl.protocol !== 'file:') return result

const parentPath = fileURLToPath(parentUrl)
const isHardcodedBoundary = this.#hardcodedBoundaryMatcher.match(resultPath)
const reloadable = context.importAttributes?.hot === 'true' ? true : isHardcodedBoundary
Expand Down

0 comments on commit a46d535

Please sign in to comment.