Skip to content

Commit 808d24b

Browse files
committed
fix(demo): correct path resolution for ghostty-web package
The findGhosttyWeb() function was incorrectly resolving the package root path. The regex /[/\\]dist[/\\].*$/ already strips the path down to the package root (e.g., '/path/to/node_modules/ghostty-web'), but then path.dirname() was called which removed one more directory level, resulting in '/path/to/node_modules' instead. This caused the 'Could not find ghostty-web package' error when running npx @ghostty-web/demo because it was looking for the WASM file and dist folder in node_modules/ instead of node_modules/ghostty-web/. Fixes the issue where npx @ghostty-web/demo@next fails with: Error: Could not find ghostty-web package.
1 parent c447ff4 commit 808d24b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

demo/bin/demo.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ function findGhosttyWeb() {
4343
// Use require.resolve to find the installed ghostty-web package
4444
try {
4545
const ghosttyWebMain = require.resolve('ghostty-web');
46-
const ghosttyWebRoot = path.dirname(ghosttyWebMain.replace(/[/\\]dist[/\\].*$/, ''));
46+
// Strip dist/... from path to get package root (regex already gives us the root)
47+
const ghosttyWebRoot = ghosttyWebMain.replace(/[/\\]dist[/\\].*$/, '');
4748
const distPath = path.join(ghosttyWebRoot, 'dist');
4849
const wasmPath = path.join(ghosttyWebRoot, 'ghostty-vt.wasm');
4950

0 commit comments

Comments
 (0)