Skip to content

Mime.types dev server error #2

Description

@tim-wise

This one might be my configuration, but I'm getting a 500 error when using the test-server.

It complains of a missing mime.types file.

{"msg":"Internal server error: ENOENT: no such file or directory, open '.../dev/digital-ocean/functions/fn-namespace/build/packages/erate/types/mime.types'"}

I deployed it to test directly on DO and see if I got more details and got the following error. Unsure if related.

2023-06-14T00:31:55.708414004Z stdout: ReferenceError: module is not defined in ES module scope
2023-06-14T00:31:55.708417622Z stdout:     at file:///tmp/index.mjs:14:53796
2023-06-14T00:31:55.708434901Z stdout:     at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

My tsconfig is below.

{
  "compilerOptions": {

    /* Language and Environment */
    "target": "ES2021",                                  /* Set the JavaScript language version for emitted JavaScript and include compatible library 

    /* Modules */
    "module": "ES2022",                                /* Specify what module code is generated. */
    "moduleResolution": "node16",                     /* Specify how TypeScript looks up a file from a given module specifier. */

    /* JavaScript Support */
    "allowJs": true,                                  /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
    "checkJs": true,                                  /* Enable error reporting in type-checked JavaScript files. */

    /* Emit */
    "sourceMap": true,                                /* Create source map files for emitted JavaScript files. */

    /* Interop Constraints */
    "verbatimModuleSyntax": true,                     /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
    // "allowSyntheticDefaultImports": true,             /* Allow 'import x from y' when a module doesn't have a default export. */
    "esModuleInterop": true,                             /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
    // "preserveSymlinks": true,                         /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
    "forceConsistentCasingInFileNames": true,            /* Ensure that casing is correct in imports. */

    /* Type Checking */
    "strict": true,                                      /* Enable all strict type-checking options. */
    "noImplicitAny": true,                            /* Enable error reporting for expressions and declarations with an implied 'any' type. */
    "strictNullChecks": true,                         /* When type checking, take into account 'null' and 'undefined'. */
  },
  "exclude": [
    "node_modules"
  ],
  "include": [
    "**/*.ts"
  ]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions