diff --git a/libs/wingsdk/src/platform/platform-manager.ts b/libs/wingsdk/src/platform/platform-manager.ts index 53d5bc3ba88..bae256fd7c5 100644 --- a/libs/wingsdk/src/platform/platform-manager.ts +++ b/libs/wingsdk/src/platform/platform-manager.ts @@ -232,9 +232,14 @@ export function _loadCustomPlatform(customPlatformPath: string): any { script.runInContext(context); return new (platformModule.exports as any).Platform(); } catch (error) { + if (process.env.DEBUG) { + console.error(error); + } + const hint = customPlatformPath.includes(".") + ? "Ensure the path to the platform is correct" + : `Ensure you have installed the platform provider by running 'npm install ${customPlatformPath}'`; console.error( - "An error occurred while loading the custom platform:", - error + `An error occurred while loading the custom platform: ${customPlatformPath}\n\n(hint: ${hint})` ); } }