trigger.dev 3.0.0-beta.42 → 3.0.0-beta.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -799,7 +799,7 @@ import invariant from "tiny-invariant";
799
799
  import { z as z4 } from "zod";
800
800
 
801
801
  // package.json
802
- var version = "3.0.0-beta.42";
802
+ var version = "3.0.0-beta.44";
803
803
  var dependencies = {
804
804
  "@anatine/esbuild-decorators": "^0.2.19",
805
805
  "@clack/prompts": "^0.7.0",
@@ -816,7 +816,7 @@ var dependencies = {
816
816
  "@opentelemetry/sdk-trace-base": "^1.22.0",
817
817
  "@opentelemetry/sdk-trace-node": "^1.22.0",
818
818
  "@opentelemetry/semantic-conventions": "^1.22.0",
819
- "@trigger.dev/core": "workspace:3.0.0-beta.42",
819
+ "@trigger.dev/core": "workspace:3.0.0-beta.44",
820
820
  "@types/degit": "^2.8.3",
821
821
  chalk: "^5.2.0",
822
822
  chokidar: "^3.5.3",
@@ -3148,13 +3148,9 @@ function parseBuildErrorStack(error) {
3148
3148
  }
3149
3149
  if (errorIsErrorLike(error)) {
3150
3150
  if (typeof error.stack === "string") {
3151
- const isErrRequireEsm = error.stack.includes("ERR_REQUIRE_ESM");
3152
- let moduleName = null;
3153
- if (isErrRequireEsm) {
3154
- const moduleRegex = /node_modules\/(@[^\/]+\/[^\/]+|[^\/]+)\/[^\/]+\s/;
3155
- const match = moduleRegex.exec(error.stack);
3156
- if (match) {
3157
- moduleName = match[1];
3151
+ if (error.stack.includes("ERR_REQUIRE_ESM")) {
3152
+ const moduleName = getPackageNameFromEsmRequireError(error.stack);
3153
+ if (moduleName) {
3158
3154
  return {
3159
3155
  type: "esm-require-error",
3160
3156
  moduleName
@@ -3166,6 +3162,27 @@ function parseBuildErrorStack(error) {
3166
3162
  }
3167
3163
  }
3168
3164
  }
3165
+ function getPackageNameFromEsmRequireError(stack) {
3166
+ const pathRegex = /require\(\) of ES Module (.*) from/;
3167
+ const pathMatch = pathRegex.exec(stack);
3168
+ if (!pathMatch) {
3169
+ return;
3170
+ }
3171
+ const filePath = pathMatch[1];
3172
+ if (!filePath) {
3173
+ return;
3174
+ }
3175
+ const lastPart = filePath.split("node_modules/").pop();
3176
+ if (!lastPart) {
3177
+ return;
3178
+ }
3179
+ const moduleRegex = /(@[^\/]+\/[^\/]+|[^\/]+)/;
3180
+ const match = moduleRegex.exec(lastPart);
3181
+ if (!match) {
3182
+ return;
3183
+ }
3184
+ return match[1];
3185
+ }
3169
3186
  function logESMRequireError(parsedError, resolvedConfig) {
3170
3187
  logger.log(
3171
3188
  `
@@ -6607,6 +6624,9 @@ function useDev({
6607
6624
  backgroundWorker
6608
6625
  );
6609
6626
  } catch (e) {
6627
+ logger.debug("Error starting background worker", {
6628
+ error: e
6629
+ });
6610
6630
  if (e instanceof TaskMetadataParseError) {
6611
6631
  logTaskMetadataParseError(e.zodIssues, e.tasks);
6612
6632
  return;