infinispan / js-client

Javascript client for Infinispan, over the Hot Rod wire protocol
https://infinispan.org/docs/hotrod-clients/js/latest/js_client.html
Apache License 2.0
15 stars 28 forks source link

wrong protobuff path #106

Closed davidkhala closed 7 months ago

davidkhala commented 7 months ago

When I run import infinispan from 'infinispan'; with version 0.11.0

It has a critical error

Exception during run: Error: ENOENT: no such file or directory, open 'C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\infinispan\lib\protostream\Protos\message-wrapping.proto'
    at Object.openSync (node:fs:581:18)
    at Object.readFileSync (node:fs:457:35)
    at fetch (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\protobufjs\src\root.js:173:34)
    at process (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\protobufjs\src\root.js:133:29)
    at fetch (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\protobufjs\src\root.js:179:13)
    at Root.load (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\protobufjs\src\root.js:207:13)
    at Root.loadSync (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\protobufjs\src\root.js:248:17)
    at Object.loadSync (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\protobufjs\src\index-light.js:69:17)
    at C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\infinispan\lib\codec.js:489:23
    at Object.<anonymous> (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\infinispan\lib\codec.js:498:4)
    at Object.<anonymous> (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\infinispan\lib\codec.js:500:3)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\infinispan\lib\infinispan.js:14:15)
    at Object.<anonymous> (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\infinispan\lib\infinispan.js:960:3)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\infinispan\index.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at cjsLoader (node:internal/modules/esm/translators:345:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:294:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
    at async formattedImport (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\mocha\lib\nodejs\esm-utils.js:9:14)
    at async exports.requireOrImport (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\mocha\lib\nodejs\esm-utils.js:42:28)
    at async exports.loadFilesAsync (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\mocha\lib\nodejs\esm-utils.js:100:20)
    at async singleRun (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\mocha\lib\cli\run-helpers.js:125:3)
    at async exports.handler (C:\Users\david\Documents\GitHub\node-databases\redhat\infinispan\node_modules\mocha\lib\cli\run.js:370:5) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\david\\Documents\\GitHub\\node-databases\\redhat\\infinispan\\node_modules\\infinispan\\lib\\protostream\\Protos\\message-wrapping.proto'
}
davidkhala commented 7 months ago

I checked the source path, .../node_modules/infinispan/lib/protostream/message-wrapping.proto does exist. So I belive removing Protos in path is enough

https://github.com/infinispan/js-client/blob/8205b357eba7f3f835b40e71604756ddeea61d3e/lib/protostream/query.proto#L8

import "Protos/message-wrapping.proto"; should be import "message-wrapping.proto";

davidkhala commented 7 months ago

This issue is also found in 0.10.0. This issue is not found in 0.9.0