Skip to content

Commit

Permalink
Fix crash (#320)
Browse files Browse the repository at this point in the history
* Fix crash

* Update changelog
  • Loading branch information
thecrypticace authored Sep 24, 2024
1 parent b1e25fd commit 081b4f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

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

## [0.6.7] - 2024-09-24

Expand Down
9 changes: 7 additions & 2 deletions src/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ export function maybeResolve(name: string) {
let modpath = resolveCache.get(name)

if (modpath === undefined) {
modpath = resolveJsFrom(fileURLToPath(import.meta.url), name)
resolveCache.set(name, modpath)
try {
modpath = resolveJsFrom(fileURLToPath(import.meta.url), name)
resolveCache.set(name, modpath)
} catch (err) {
resolveCache.set(name, null)
return null
}
}

return modpath
Expand Down

0 comments on commit 081b4f5

Please sign in to comment.