diff --git a/components/SnippetsManager.tsx b/components/SnippetsManager.tsx index cae8ecd22..2b585a9ef 100644 --- a/components/SnippetsManager.tsx +++ b/components/SnippetsManager.tsx @@ -257,6 +257,11 @@ const SnippetsManager: React.FC = ({ // At root level, preserve the leading slash if user intended it full = name; } + + // Strip trailing slash to ensure consistent path handling + if (full.endsWith('/')) { + full = full.slice(0, -1); + } // Check for duplicate package names (case-insensitive) const existingPackage = packages.find(p => p.toLowerCase() === full.toLowerCase());