Actually I think with some trial and error I just figured it out 
I had an import statement like so:
const http_app = import('../../pentest/pipedream/components/http/http.app.mjs')
If I changed this to:
const http_app = import('../pipedream/components/http/http.app.mjs')
Then I started getting expected errors (syntax error and the like). The output of the PD CLI as far as packaging was exactly the same, but it seems like the “…/…/” was triggering some kind of server-side problem?
Note that both the first and second relative paths were valid.
Thanks so much for providing Pipedream by the way, I literally use it every day and it’s a fantastic resource!
Cheers,
~~ Peter
Sample, much simplified, code to reproduce (please adjust paths accordingly but the “…/…/” must be correct to see the 500 error):
const http_app = import('../../pentest/pipedream/components/http/http.app.mjs')
// Core HTTP component
module.exports = {
key: "pmnh-custom-requests-bug-demo",
name: "HTTP Request Handler by @pmnh",
description: "Sample script to reproduce issue",
version: "0.0.7",
props: {
http: {
type: "$.interface.http",
customResponse: true,
},
theSlug: {
type: "string",
label: "Project Slug",
description: "Slug for the project name, e.g. Uber",
optional: false,
default: "unknown"
},
emitBodyOnly: {
type: "boolean",
label: "Body Only",
description: "This source emits an event representing the full HTTP request by default. Select TRUE to emit the body only.",
optional: true,
default: false,
},
resStatusCode: {
type: "string",
label: "Response Status Code",
description: "The status code to return in the HTTP response.",
optional: true,
default: '200',
},
resContentType: {
type: "string",
label: "Response Content-Type",
description: "The content-type of the body returned in the HTTP response.",
optional: true,
default: `application/json`,
},
resBody: {
type: "string",
label: "Response Body",
description: "The body to return in the HTTP response.",
optional: true,
default: `{ "success": true }`,
},
},
async run(event) {
const summary = `${event.method} ${event.path}`
var headers = {
"content-type": this.resContentType,
};
host = event.headers["host"]
this.http.respond({
status: this.resStatusCode,
body: this.resBody,
headers: headers,
});
event.key = this.key
if(this.emitBodyOnly) {
this.$emit(event.body, { summary })
} else {
this.$emit(event, { summary })
}
}
}