Skip to content

SES_UNCAUGHT_EXCEPTION:{} in build process #3304

@floor-licker

Description

@floor-licker

The key problem is SES_UNCAUGHT_EXCEPTION: {} which unfortunately does not provide details about the actual exception.

Observed vs. Expected Behavior

  • Observed: The snap build fails with an empty uncaught exception in the SES environment
  • Expected: The build process should complete successfully or provide more details about the specific exception

Investigation Notes

  1. The warning about Math.random() is not causing the build failure - it's just a warning about security best practices
  2. The actual failure is likely due to one of our dependencies using code patterns that are incompatible with SES but for some reason I'm not getting any information about what the root cause is.
  3. The error mentions deprecated SES options (dateTaming and mathTaming) but that should be unrelated to the build failure

Environment Information

  • OS: macOS (darwin 24.3.0)
  • Node.js Version: ≥ 18.6.0
  • Package Manager: yarn v3.2.1
  • MetaMask Snaps CLI Version: 6.6.0
  • MetaMask Snaps SDK Version: 6.18.0

Build output:
juliustranquilli@Pixel-5 white-label % yarn build [site]: Process started [snap]: Process started [site]: success compile gatsby files - 0.512s success load gatsby config - 0.008s success load plugins - 0.108s success onPreInit - 0.001s success delete worker cache from previous builds - 0.002s success initialize cache - 0.011s success copy gatsby files - 0.044s success Compiling Gatsby Functions - 0.082s success onPreBootstrap - 0.091s success createSchemaCustomization - 0.000s success Clean up stale nodes - 0.004s - 1/0 0.00/s success Checking for changed pages - 0.000s success source and transform nodes - 0.039s info Writing GraphQL type definitions to [site]: /Users/juliustranquilli/webisoft/white-label/packages/site/.cache/schema.gql success building schema - 0.153s success createPages - 0.017s success createPagesStatefully - 0.047s info Total nodes: 27, SitePage nodes: 1 (use --verbose for breakdown) success Checking for changed pages - 0.000s success Cleaning up stale page-data - 0.001s success onPreExtractQueries - 0.000s success extract queries from components - 0.127s success write out redirect data - 0.001s success Build manifest and related icons - 0.078s success onPostBootstrap - 0.079s info bootstrap finished - 2.645s success write out requires - 0.002s success Building production JavaScript and CSS bundles - 0.703s success Building HTML renderer - 1.540s success Execute page configs - 0.025s success Caching Webpack compilations - 0.000s success run queries in workers - 0.002s - 0/0 0.00/s success Merge worker state - 0.001s info There are no new or changed html files to build. info There are no new or changed slice html files to build. success stitching slices - 0.000s success onPostBuild - 0.000s info Done building in 6.025864584 sec [site]: [site]: [site]: Pages [site]: [site]: └ src/pages/index.tsx [site]: └ / [site]: [site]: ╭────────────────────────────────────────────────────────────────╮ [site]: │ │ [site]: │ (SSG) Generated at build time │ [site]: │ D (DSG) Deferred static generation - page generated at runtime │ [site]: │ ∞ (SSR) Server-side renders at runtime (uses getServerData) │ [site]: │ λ (Function) Gatsby function │ [site]: │ │ [site]: ╰────────────────────────────────────────────────────────────────╯ [site]: [site]: Process exited (exit code 0), completed in 6s 339ms [snap]: - Checking the input file. [snap]: - Building the snap bundle. [snap]: - Evaluating the snap bundle. [snap]: ⚠ Compiled 659 files in 12354ms with 1 warning. [snap]: [snap]: • Math.randomwas detected in the Snap bundle. This is not a secure source of randomness, and should not be used in a secure context. Usecrypto.getRandomValuesinstead. [snap]: [snap]: ✖ Error: Failed to evaluate snap bundle in SES. This is likely due to an incompatibility with the SES environment in your snap. [snap]: Received the following error from the SES environment: [snap]: [snap]: SES The 'dateTaming' option is deprecated and does nothing. In the future specifying it will be an error. [snap]: SES The 'mathTaming' option is deprecated and does nothing. In the future specifying it will be an error. [snap]: SES_UNCAUGHT_EXCEPTION: {} [snap]: [snap]: at evaluate (/Users/juliustranquilli/webisoft/white-label/node_modules/@metamask/snaps-cli/dist/commands/eval/implementation.cjs:22:19) [snap]: at process.processTicksAndRejections (node:internal/process/task_queues:105:5) [snap]: at async Object.task (/Users/juliustranquilli/webisoft/white-label/node_modules/@metamask/snaps-cli/dist/commands/build/build.cjs:48:13) [snap]: at async /Users/juliustranquilli/webisoft/white-label/node_modules/@metamask/snaps-cli/dist/utils/steps.cjs:34:32 [snap]: at async /Users/juliustranquilli/webisoft/white-label/node_modules/@metamask/snaps-cli/dist/utils/steps.cjs:26:36 [snap]: at async executeSteps (/Users/juliustranquilli/webisoft/white-label/node_modules/@metamask/snaps-cli/dist/utils/steps.cjs:25:9) [snap]: at async buildHandler (/Users/juliustranquilli/webisoft/white-label/node_modules/@metamask/snaps-cli/dist/commands/build/build.cjs:73:12) [snap]: Process exited (exit code 1), completed in 13s 789ms The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph Failed with errors in 13s 796ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions