forked from ZJONSSON/parquetjs
-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
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:
Steps to reproduce
- add this
parquetjsto my project - start an app via running
wrangler dev - 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.
shannonwells
Metadata
Metadata
Assignees
Labels
No labels
{ "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" } }