gosqasorg / asset-provenance-tracking

Node.js implementation, using Azure as a backend, of a system for Global Distributed Tracking, a free-of-charge, free-software system for building up a provenance or history of objects/assets/devices.
https://gosqas.org/
GNU Affero General Public License v3.0
4 stars 3 forks source link

[BUG] Direct navigation to device page fails #178

Open devhawk opened 2 weeks ago

devhawk commented 2 weeks ago

Describe the bug Navigating to a device page by creating a device from the new frontend home page works, but if you navigate to the device page any other way, you get redirected to the home page w/o showing the device page

To Reproduce Navigate to an existing device page (example: https://red-stone-00f5d251e.5.azurestaticapps.net/device/KpjmnKHyFEn1LaAHaTTA4D)

Expected behavior Expected the device page to appear

Additional context The device page works correctly when running locally in dev mode (npm run dev) When running the new front end locally in production mode (npm run build followed by npm run preview), I see the same redirect behavior that we see with the published site and I get the following error message on the console

file:///home/harry/asset-provenance-tracking/packages/frontend/.output/server/chunks/build/_deviceKey_-DA8D7B8t.mjs:4
import QRCodeVue3 from 'qrcode-vue3';
       ^^^^^^^^^^
SyntaxError: The requested module 'qrcode-vue3' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async setup (file:///home/harry/asset-provenance-tracking/packages/frontend/.output/server/chunks/build/server.mjs:845:76)
    at async Object.callAsync (file:///home/harry/asset-provenance-tracking/packages/frontend/.output/server/chunks/build/server.mjs:89:16)
    at async applyPlugin (file:///home/harry/asset-provenance-tracking/packages/frontend/.output/server/chunks/build/server.mjs:217:35)
    at async executePlugin (file:///home/harry/asset-provenance-tracking/packages/frontend/.output/server/chunks/build/server.mjs:255:9)
    at async applyPlugins (file:///home/harry/asset-provenance-tracking/packages/frontend/.output/server/chunks/build/server.mjs:263:5)
    at async createNuxtAppServer (file:///home/harry/asset-provenance-tracking/packages/frontend/.output/server/chunks/build/server.mjs:1350:7)
    at async Object.renderToString (file:///home/harry/asset-provenance-tracking/packages/frontend/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs:173:19)