yaacov/node-modbus-serial

fail on tsc buid with version 8.0.7

dbettoni opened this issue · 14 comments

On last version 8.0.7 my tsc build produce this error:

tsc

node_modules/modbus-serial/ModbusRTU.d.ts:2:22 - error TS7016: Could not find a declaration file for module './ports/testport'. '...../node_modules/modbus-serial/ports/testport.js' implicitly has an 'any' type.

2 import TestPort from './ports/testport';

8.0.6 is OK

Hi, thanks for the issue 🔥

Can you make a pull request fixing it ?

I can try but I don't know when I have time to do it,
for now my project works by setting the dependency to "modbus-serial": "8.0.6",

The issue looks related to #479
@chaos2171053 hi, can you take a look ?

@dbettoni can you add more information that will help understand the problem, link to your code ?
for example:
how you use the module in your project ?
how do you get the error ?

On last version 8.0.7 my tsc build produce this error:

tsc

node_modules/modbus-serial/ModbusRTU.d.ts:2:22 - error TS7016: Could not find a declaration file for module './ports/testport'. '...../node_modules/modbus-serial/ports/testport.js' implicitly has an 'any' type.

2 import TestPort from './ports/testport';

8.0.6 is OK

fix on this pr .Can u provie more information to repoduce this bug?May be i can make this pr better.

#484 is merged @dbettoni can you check the fix ?

I tried to rebuild my project by importing modbus-serial 8.0.7 but the problem hasn't been resolved.
see attached image
Schermata 2022-11-29 alle 12 44 47

my tsconfig.json:
Schermata 2022-11-29 alle 14 14 22

@dbettoni hi, 8.0.7 does not have the fix, it will be in 8.0.8, can you test the code from github ?

I tried to rebuild my project by importing modbus-serial 8.0.7 but the problem hasn't been resolved. see attached image Schermata 2022-11-29 alle 12 44 47

Hi @dbettoni ,version 8.0.7 has not inclued the #484 ,you can use npm install "https://github.com/yaacov/node-modbus-serial#master ---save to use the latest code.

Install specific branch from github using Npm](https://stackoverflow.com/questions/39732397/install-specific-branch-from-github-using-npm)

@yaacov how about adding github ci scripts to publish the latest code to npm when pr is merged to the master or specific branch ?

@yaacov how about adding github ci scripts to publish the latest code to npm when pr is merged to the master or specific branch ?

an action that publish on new release will be nice :-)
but this fix will need the npm secret, I can look at a PR that assume an npm secret exist, and add the needed secret

perfect, with the "modbus-serial" dependency: "git+https://github.com/yaacov/node-modbus-serial.git#master", everything is OK
Thanks for all

8.0.8 is release 🍰

OK Thanks

still can't build using 8.0.8
node version: v18.11.0
deps:

  • "modbus-serial": "^8.0.8"
  • "@types/node": "^18.11.10"
  • "typescript": "^4.9.3"
    Screenshot 2022-12-01 at 15 01 36