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.

  • Version: “electron-builder”: “^20.38.4”
  • Target: macOS & Windows x64

I am writing a small app that utilises serialport as dependency (which itself has native dependencies). When starting the app in dev mode (npm-run-all --parallel bundle serve) everything is working fine. I am using electron-rebuild as postinstall script to compile the native dependencies for the used Electron (4.0.0) version. When building the app for production issuing yarn build && electron-builder build --publish never, I cannot start the app bundle with the following error in the macOS log:

Dyld Error Message:
  Symbol not found: __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorE
  Referenced from: /var/folders/*/.com.my.app.a9yuVC
  Expected in: flat namespace

After I have tried building the app, I am no longer able to start the app in dev mode with the shown command. This error is shown when starting the app in dev mode:

dyld: lazy symbol binding failed: Symbol not found: __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorE
  Referenced from: /Client/node_modules/@serialport/bindings/build/Release/bindings.node
  Expected in: flat namespace

dyld: Symbol not found: __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorE
  Referenced from: /Client/node_modules/@serialport/bindings/build/Release/bindings.node
  Expected in: flat namespace

I have to run $(npm bin)/electron-builder install-app-deps first, only after that I can start the app in dev mode again. Running ($npm bin)/electron-rebuild does not work for some reason.

It seems, that this is an issue with the packaging. I am quite new to all the electron, nodejs stuff so I do not think this is a bug. Probably my configuration is wrong. Could anyone please help me out?


EDIT: I’ve created a small test application to reproduce the issue. Maybe it’s helpful. https://github.com/phhoef/serialport-test

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
gniezencommented, Jan 9, 2019

@benoist I downgraded keytar to v4.2.1 as a workaround.

2reactions
benoistcommented, Jan 7, 2019

I’m seeing the same issue.

I have the “postinstall”: “electron-builder install-app-deps”, added to my package.json

After running yarn I see

$ electron-builder install-app-deps
  • electron-builder version=20.38.4
  • loaded configuration file=package.json ("build" field)
  • rebuilding native production dependencies platform=darwin arch=x64
  • rebuilding native dependency name=fsevents
  • rebuilding native dependency name=keytar
✨  Done in 8.07s.

Then when I start I get this message:

$ webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js --mode development
ℹ 「wds」: Project is running at http://0.0.0.0:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from ..redacted../dist
ℹ 「wds」: 404s will fallback to /index.html
dyld: lazy symbol binding failed: Symbol not found: __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorE
  Referenced from: ..redacted../node_modules/keytar/build/Release/keytar.node
  Expected in: flat namespace

dyld: Symbol not found: __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorE
  Referenced from: ..redacted../node_modules/keytar/build/Release/keytar.node
  Expected in: flat namespace

✨  Done in 1.57s.

When I run $(npm bin)/electron-builder install-app-deps I see:

  • electron-builder version=20.38.4
  • loaded configuration file=package.json ("build" field)
  • rebuilding native production dependencies platform=darwin arch=x64

And after that the app starts normally.

When I try to release the app, it runs the install-app-deps again as it did with the postinstall And this causes the same crash in the release version.

    "electron": "^4.0.1",
    "electron-builder": "^20.38.4",
Read more comments on GitHub >

github_iconTop Results From Across the Web

dyld Symbol not found | Apple Developer Forums
My app, written in Objective C, includes Framework A via a CocoaPod. When I attempt to run the app I get the following...
Read more >
objective c - dyld: Symbol not found ...
My app is crashing with the message: dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate. Referenced from: / ...
Read more >
Custom Framework : dyld: Symbol not found: _ ... - GitHub
As soon as the client app launches it crashes with below crash logs. I have seen this issue reported many other places on...
Read more >
DYLD, Symbol not found - Jean-David Morgenstern-P
Apple crash report points to a missing symbol referenced in some custom framework. Looking at the crashing thread backtrace, we see indeed ...
Read more >
[Solved] Symbol not found - Python Pool
“Symbol not found” error is raised when the definition of the declared function or variable is not found. When a header file of...
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