question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in driver ZWaveError: Failed to initialize the driver: core_1.shouldLogNode is not a function

See original GitHub issue

Checklist:

  • I am not using HomeAssistant. Or: a developer has told me to come here.
  • I am not using ZWaveJS2MQTT. Or: a developer has told me to come here.
  • I have checked the troubleshooting section and my problem is not described there.
  • I have read the changelog problem was not mentioned there.

Describe the bug

After installing zwave-js-server and zwave-js@6.4.0, I get an error trying to run the server.

Device information

N/A

Did you change anything?

  • Yes: (please describe)
  • No

Did this use to work before?

  • Don’t know, this is a new device
  • No, it never worked anywhere
  • Yes, in: (specify application with versions) 6.4.0 when installed about 4 days ago.

How are you using node-zwave-js

  • zwavejs2mqtt (latest) docker image
  • zwavejs2mqtt (dev) docker image
  • zwavejs2mqtt Manual Docker build
    • node-zwave-js branch:
    • zwavejs2mqtt branch:
  • ioBroker.zwave2 adapter
  • HomeAssistant version XYZ
  • Pkg
  • Manual Docker build
    • node-zwave-js branch:
    • zwavejs2mqtt branch: Any beta7-beta9.
  • Manually built (as described in the docs)
  • Other: Manually installed with npm or yarn

To Reproduce

Steps to reproduce the behavior:

  1. Use npm or yarn to install the packages. Install zwave-js@6.4.0 or actually any older version. I have not tried 6.5.0.
  2. Start the zwave-server.
  3. Watch an exception.
  4. See error

Additional context

I am building my own zwave-js-container. I build a beta8 container about 4 days ago with the same (?) 6.4.0 and it works fine. I am building a new container, beta9 with 6.4.0 and it no longer works. It doesn’t matter whether I install 6.3.0 either.

Error in driver ZWaveError: Failed to initialize the driver: core_1.shouldLogNode is not a function
    at Immediate.<anonymous> (/app/node_modules/zwave-js/src/lib/driver/Driver.ts:739:6) {
  code: 5,
  context: undefined,
  transactionSource: undefined
}

Logfile: zwave_js.log

I notice that npm list is showing the version 6.5.0 of zwave-js even though I installed 6.4.0, not sure if that means anything.

/app # npm list | grep zwave-js
+-- @zwave-js/server@1.0.0-beta.9
`-- zwave-js@6.4.0
  +-- @zwave-js/config@6.5.0
  | +-- @zwave-js/core@6.5.0 deduped
  | +-- @zwave-js/shared@6.5.0 deduped
  +-- @zwave-js/core@6.5.0
  | +-- @zwave-js/shared@6.5.0 deduped
  +-- @zwave-js/serial@6.5.0
  | +-- @zwave-js/core@6.5.0 deduped
  +-- @zwave-js/shared@6.5.0

If I search for shouldLogNode in my good container vs. bad, I notice that the function used to be exported, and is not now. Again, I don’t know if that actually means anything, but it’s a difference. There was a change to this function in 6.5.0 and now it’s no longer exported. Not sure why changes there should affect an install of 6.4.0.

Bad

node_modules/@zwave-js/core/build/log/shared.js
282:    shouldLogNode(nodeId) {

Good

@zwave-js/core/build/log/shared.js
25:exports.restoreSilence = exports.unsilence = exports.tagify = exports.messageRecordToLines = exports.messageToLines = exports.messageFitsIntoOneLine = exports.shouldLogNode = exports.ZWaveLogContainer = exports.ZWaveLoggerBase = exports.getNodeTag = exports.LOG_PREFIX_WIDTH = exports.LOG_WIDTH = exports.directionPrefixPadding = exports.CONTROL_CHAR_WIDTH = exports.getDirectionPrefix = exports.timestampFormat = void 0;
281:function shouldLogNode(nodeId) {
290:exports.shouldLogNode = shouldLogNode;

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AlCalzonecommented, Feb 24, 2021

The public API didn’t change, but the internal one often breaks between releases. I guess I should configure the internal dependencies to use ~ ranges instead.

0reactions
AlCalzonecommented, Feb 24, 2021

I don’t think so - 6.5.0 didn’t exist until a few hours ago. Although your comment matches my assessment that something with the prerelease versions in there was off.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Z wave js failed to initialize the driver
This just started happening after updating Home Asistant and Home Assistant OS a couple days ago. It was woirking fine before this.
Read more >
Failed to initialize the driver · Issue #16 - GitHub
I removed that and installed this one but keep getting this error. ... The official add-on used /dev/ttyUSB0. I tried that and the...
Read more >
ZWave JS "Failed to connect" issue : r/homeassistant - Reddit
I let it run for a while and saw a popup with "Error - Config flow failed to load". As soon as I...
Read more >
How to fix Home Assistant Z-Wave connection issue?
The control panel for Z-Wave JS does not list any devices and shows a red error message “Driver: Failed to initialize the driver:...
Read more >
How detect Z-Wave JS driver frozen/stuck - Node-RED Forum
[error] [zwave-js:Z-Wave JS Controller] ZWaveError: Failed to open the serial ... if a stick is not performing then you will see this error,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found