diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index 8cd5cf439d7..d7f55b6f638 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -23,7 +23,7 @@ const envPublicUrl = process.env.PUBLIC_URL; function ensureSlash(path, needsSlash) { const hasSlash = path.endsWith('/'); if (hasSlash && !needsSlash) { - return path.substr(path, path.length - 1); + return path.substr(0, path.length - 1); } else if (!hasSlash && needsSlash) { return `${path}/`; } else {