Skip to content

Commit 6f5bb9b

Browse files
committed
fix: strip trailing slashes from instance URL in LightningDevComponent
1 parent 75eaad8 commit 6f5bb9b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/commands/lightning/dev/component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,11 @@ export default class LightningDevComponent extends SfCommand<ComponentPreviewRes
154154
// Construct and log the full URL that will be opened
155155
const connection = targetOrg.getConnection(apiVersion);
156156

157+
// strip trailing slashes
158+
const instanceUrl = connection.instanceUrl.replace(/\/$/, '');
159+
157160
const previewUrl = PreviewUtils.generateComponentPreviewUrl(
158-
connection.instanceUrl,
161+
instanceUrl,
159162
ldpServerUrl,
160163
ldpServerId,
161164
componentName,
@@ -164,7 +167,7 @@ export default class LightningDevComponent extends SfCommand<ComponentPreviewRes
164167

165168
// Prepare the result for JSON output
166169
const result: ComponentPreviewResult = {
167-
instanceUrl: connection.instanceUrl,
170+
instanceUrl,
168171
ldpServerUrl,
169172
ldpServerId,
170173
componentName: componentName ?? '',

0 commit comments

Comments
 (0)