Skip to content

Conversation

@bedirxanugur
Copy link

When saxi is installed globally via npm install -g saxi,
the web interface returns "Cannot GET /" error.

This fixes the issue by using import.meta.url to resolve
the static files path relative to the module location instead
of the current working directory.

Tested on Raspberry Pi with global installation.

@alexrudd2
Copy link
Owner

Thanks for the PR!

Do you mind turning your autoformatter off and re-submitting? The actual change is a little hard to find.

@alexrudd2
Copy link
Owner

thanks; it's clear now. Looks like meta.import.url doesn't work with module:es2022. The options I can see are:
(1) switch to module:nodenext

src/serialport-serialport.ts:2:34 - error TS7016: Could not find a declaration file for module '@serialport/bindings-interface'. '/home/alex/git/saxi/node_modules/@serialport/bindings-interface/dist/index-esm.mjs' implicitly has an 'any' type.
  There are types at '/home/alex/git/saxi/node_modules/@serialport/bindings-interface/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@serialport/bindings-interface' library may need to update its package.json or typings.

upstream has not merged the PR which should fix this: serialport/bindings-interface#32

(2) switch to module:es2020

@alexrudd2
Copy link
Owner

Goddamn it jest. Maybe I should switch to vitest

@alexrudd2
Copy link
Owner

@bedirxanugur Mind trying this version? It works for me, both npm run start and npm i -g saxi && saxi

@bedirxanugur
Copy link
Author

Tested successfully! Built locally on Windows, deployed to Raspberry Pi, and everything’s running smoothly. Thanks for the changes!

@alexrudd2
Copy link
Owner

Tested successfully! Built locally on Windows, deployed to Raspberry Pi, and everything’s running smoothly. Thanks for the changes!

Thanks for your fix!

===

For my own curiosity, which generation RPi? Am I correctly assuming it's an older/under-powered one since you're "building" on a laptop and then copying the files over? There are lots of older performance bugs in the original repo (https://github.com/nornagon/saxi) and it's hard to tell which have been solved already.

@alexrudd2 alexrudd2 merged commit 374744f into alexrudd2:main Oct 14, 2025
7 checks passed
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

Successfully merging this pull request may close these issues.

3 participants