diff --git a/package.json b/package.json index d1fa8d5..b288452 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "remix-development-tools", "description": "Remix development tools - a set of tools for developing/debugging Remix.run apps", "author": "Alem Tuzlak", - "version": "4.5.1", + "version": "4.5.2", "license": "MIT", "keywords": [ "remix", diff --git a/src/vite/plugin.tsx b/src/vite/plugin.tsx index 36c14fa..36c4171 100644 --- a/src/vite/plugin.tsx +++ b/src/vite/plugin.tsx @@ -96,7 +96,10 @@ export const remixDevTools: (args?:RemixViteConfig) => Plugin[] = (args) => { if (!server.config.isProduction) { const { exec } = await import("node:child_process"); - const openInVsCode = (path: string, lineNum: string) => { + const openInVsCode = (path: string | undefined, lineNum: string) => { + if(!path){ + return; + } exec(`code -g "${normalizePath(path)}${lineNum}"`); } @@ -140,7 +143,7 @@ export const remixDevTools: (args?:RemixViteConfig) => Plugin[] = (args) => { routeFile && openInVsCode(path.join(remixDir, routeID, routeFile), lineNum); return; } - return openInVsCode(path.join(validPath), lineNum); + return openInVsCode(validPath, lineNum); } }); }