Skip to content

Dependency for thrift #176

@ryokaji

Description

@ryokaji

It seems that an error occurs if thrift is not included in a node v22 project.
May I know if this is a known issue as reported at #102 ?

thrift should build

Precondition

  • node: v22.14.0
  • project:
{
  "name": "my-app",
  "type": "module",
  "scripts": {
    "dev": "wrangler dev",
    "deploy": "wrangler deploy --minify",
    "cf-typegen": "wrangler types --env-interface CloudflareBindings"
  },
  "dependencies": {
    "@dsnp/parquetjs": "^1.8.7",
    "hono": "^4.9.1",
    "thrift": "^0.22.0" // we can work around this issue by appending it
  },
  "devDependencies": {
    "wrangler": "^4.4.0"
  }
}

Steps to reproduce

  1. add this parquetjs to my project
  2. start an app via running wrangler dev
  3. fails to start with the following logs

Logs

✘ [ERROR] Build failed with 2 errors:

  ✘ [ERROR] Could not resolve "thrift"
  
      node_modules/@dsnp/parquetjs/dist/gen-nodejs/parquet_types.js:7:21:
        7 │ var thrift = require('thrift');
          ╵                      ~~~~~~~~
  
    You can mark the path "thrift" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle. You can also surround this "require" call with
  a try/catch block to handle this failure at run-time instead of bundle-time.
  
  
  ✘ [ERROR] Could not resolve "thrift"
  
      node_modules/@dsnp/parquetjs/dist/lib/util.js:40:41:
        40 │ const thrift_1 = __importDefault(require("thrift"));
           ╵                                          ~~~~~~~~
  
    You can mark the path "thrift" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle. You can also surround this "require" call with
  a try/catch block to handle this failure at run-time instead of bundle-time.

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