Skip to content

Commit 3610a45

Browse files
committed
fix: server url
1 parent 8fcf34b commit 3610a45

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/commands/lightning/dev/component.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default class LightningDevComponent extends SfCommand<ComponentPreviewRes
7979
if (process.env.AUTO_ENABLE_LOCAL_DEV === 'true') {
8080
try {
8181
await MetaUtils.ensureLightningPreviewEnabled(targetOrg.getConnection(undefined));
82+
await MetaUtils.ensureFirstPartyCookiesNotRequired(targetOrg.getConnection(undefined));
8283
} catch (error) {
8384
this.log('Error autoenabling local dev', error);
8485
}
@@ -176,13 +177,7 @@ export default class LightningDevComponent extends SfCommand<ComponentPreviewRes
176177
// strip trailing slashes
177178
const instanceUrl = connection.instanceUrl.replace(/\/$/, '');
178179

179-
const previewUrl = PreviewUtils.generateComponentPreviewUrl(
180-
instanceUrl,
181-
ldpServerUrl,
182-
ldpServerId,
183-
componentName,
184-
false
185-
);
180+
const previewUrl = PreviewUtils.generateComponentPreviewUrl(instanceUrl, ldpServerUrl, ldpServerId, componentName);
186181

187182
// Prepare the result for JSON output
188183
const result: ComponentPreviewResult = {

src/shared/previewUtils.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,7 @@ export class PreviewUtils {
238238
componentName?: string,
239239
targetOrg?: string
240240
): string[] {
241-
let appPath = `lwr/application/e/devpreview/ai/${encodeURIComponent(
242-
'localdev%2Fpreview'
243-
)}?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`;
241+
let appPath = `lwr/application/e/devpreview/ai/localdev-preview?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`;
244242
if (componentName) {
245243
// TODO: support other namespaces
246244
appPath += `&specifier=c/${componentName}`;
@@ -269,12 +267,9 @@ export class PreviewUtils {
269267
instanceUrl: string,
270268
ldpServerUrl: string,
271269
ldpServerId: string,
272-
componentName?: string,
273-
encodePath = false
270+
componentName?: string
274271
): string {
275-
let url = `${instanceUrl}/lwr/application/e/devpreview/ai/${
276-
encodePath ? encodeURIComponent('localdev%2Fpreview') : 'localdev%2Fpreview'
277-
}?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`;
272+
let url = `${instanceUrl}/lwr/application/e/devpreview/ai/localdev-preview?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`;
278273
if (componentName) {
279274
// TODO: support other namespaces
280275
url += `&specifier=c/${componentName}`;

0 commit comments

Comments
 (0)