Skip to content

Commit 081b4f5

Browse files
Fix crash (#320)
* Fix crash * Update changelog
1 parent b1e25fd commit 081b4f5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
- Fix crash ([#320](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/320))
1111

1212
## [0.6.7] - 2024-09-24
1313

src/resolve.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ export function maybeResolve(name: string) {
4040
let modpath = resolveCache.get(name)
4141

4242
if (modpath === undefined) {
43-
modpath = resolveJsFrom(fileURLToPath(import.meta.url), name)
44-
resolveCache.set(name, modpath)
43+
try {
44+
modpath = resolveJsFrom(fileURLToPath(import.meta.url), name)
45+
resolveCache.set(name, modpath)
46+
} catch (err) {
47+
resolveCache.set(name, null)
48+
return null
49+
}
4550
}
4651

4752
return modpath

0 commit comments

Comments
 (0)