Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) TypeError: Cannot read property 'filter' of undefined #239

Open
jwillikers opened this issue Aug 12, 2021 · 0 comments

Comments

@jwillikers
Copy link

Flatpak Issue

Description

When running inside a Flatpak, it seems that avrgirl-arduino version 4.2.3 runs into problems stemming from the node-serialport library not finding available ports when flashing an Arduino.
The node-serialport library can't list ports because it relies on the command-line tool udevadm, which is not available within a Flatpak.
This is further described in issue serialport/node-serialport#2306.
I'm currently working on packaging the Chrysalis application and the following stacktrace shows an error when flashing an upgrade to an attached Arduino device.

/app/main/resources/app.asar/node_modules/avrgirl-arduino/lib/connection.js:66 Uncaught (in promise) TypeError: Cannot read property 'filter' of undefined
    at /app/main/resources/app.asar/node_modules/avrgirl-arduino/lib/connection.js:66
    at /app/main/resources/app.asar/node_modules/avrgirl-arduino/lib/connection.js:192
(anonymous) @ /app/main/resources/app.asar/node_modules/avrgirl-arduino/lib/connection.js:66
(anonymous) @ /app/main/resources/app.asar/node_modules/avrgirl-arduino/lib/connection.js:192
Promise.catch (async)
Connection._listPorts @ /app/main/resources/app.asar/node_modules/avrgirl-arduino/lib/connection.js:192
Connection._sniffPort @ /app/main/resources/app.asar/node_modules/avrgirl-arduino/lib/connection.js:64
Connection._init @ /app/main/resources/app.asar/node_modules/avrgirl-arduino/lib/connection.js:17
(anonymous) @ /app/main/resources/app.asar/node_modules/avrgirl-arduino/avrgirl-arduino.js:105
AvrgirlArduino._validateBoard @ /app/main/resources/app.asar/node_modules/avrgirl-arduino/avrgirl-arduino.js:87
AvrgirlArduino.flash @ /app/main/resources/app.asar/node_modules/avrgirl-arduino/avrgirl-arduino.js:101
(anonymous) @ renderer.js:2
Avr109Bootloader @ renderer.js:2
async function (async)
Avr109Bootloader @ renderer.js:2
Avr109 @ renderer.js:2
async function (async)
Avr109 @ renderer.js:2
flash @ renderer.js:2
(anonymous) @ renderer.js:2
async function (async)
(anonymous) @ renderer.js:2
(anonymous) @ renderer.js:2
async function (async)
(anonymous) @ renderer.js:2
(anonymous) @ renderer.js:2
Cg @ renderer.js:2
Ji @ renderer.js:2
Sj @ renderer.js:2
n.unstable_runWithPriority @ renderer.js:2
cg @ renderer.js:2
Jj @ renderer.js:2
yj @ renderer.js:2
(anonymous) @ renderer.js:2
n.unstable_runWithPriority @ renderer.js:2
cg @ renderer.js:2
fg @ renderer.js:2
gg @ renderer.js:2
Ga @ renderer.js:2
gd @ renderer.js:2

This appears to stem from the _sniff_ports function calling filter on an empty list of ports from node-serialport.
Flashing works as expected when Chrysalis runs outside the Flatpak.

Expected behaviour

I expect the avrgirl-arduino library to flash the firmware to the Arduino whether it's running inside a Flatpak or not.

Actual behaviour

There's an unexpected error inside a promise coming from the avrgirl-arduino's flash function.

Operating system and version

Fedora Silverblue 34

The exact information about how the system is compiled can be found in the Flatpak manifest in my Chrysalis fork here.

Linux and Unix based systems

Linux precision 5.13.8-200.fc34.x86_64 #1 SMP Wed Aug 4 19:59:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Avrgirl Arduino version

4.2.3

NodeJS version

v14.17.5

Arduino Board being used

ATmega32U4

Log output, if available

See stacktrace provided above.

Step by step guide to reproducing the issue

todo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant