BridgeCityBicycleCoop / workstand-shop-app

Open Source Application for running a Bicycle Coop Shop
MIT License
2 stars 1 forks source link

500 Error: Clean Build #79

Closed FeXd closed 2 months ago

FeXd commented 3 months ago

While working on the README.md file, I took the opportunity to build from scratch. Everything worked fine until I tried to log in, which I was greeted with 500 error page.

Note that this build was from the HEAD of readme-updates. I will try to from main later if I have time.

image

Terminal Output

arlin@arlin-mac:~/Git/workstand-shop-app$ node --version
v20.11.1
arlin@arlin-mac:~/Git/workstand-shop-app$ npm install

added 594 packages, and audited 595 packages in 19s

120 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New minor version of npm available! 10.2.4 -> 10.8.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
npm notice Run npm install -g npm@10.8.2 to update!
npm notice 
arlin@arlin-mac:~/Git/workstand-shop-app$ npm run dev

> workstand@0.0.1 dev
> vite dev

Sudo password:
The list of generated files:
/Users/arlin/.vite-plugin-mkcert/dev.pem
/Users/arlin/.vite-plugin-mkcert/cert.pem
Forced re-optimization of dependencies

  VITE v5.2.11  ready in 18569 ms

  ➜  Local:   https://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
12:31:37 PM [vite] ✨ new dependencies optimized: date-fns, zod, ts-deepmerge, just-clone, nanoid/non-secure
12:31:37 PM [vite] ✨ optimized dependencies changed. reloading
12:31:39 PM [vite] ✨ new dependencies optimized: sveltekit-superforms/client, formsnap, sveltekit-superforms
12:31:39 PM [vite] ✨ optimized dependencies changed. reloading
Error: Cannot subscribe to 'page' store on the server outside of a Svelte component, as it is bound to the current request via component context. This prevents state from leaking between users.For more information, see https://kit.svelte.dev/docs/state-management#avoid-shared-state-on-the-server
    at get_store (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/app/stores.js:89:9)
    at Object.subscribe (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/app/stores.js:35:37)
    at Module.subscribe (/Users/arlin/Git/workstand-shop-app/node_modules/svelte/src/runtime/internal/utils.js:139:22)
    at eval (/Users/arlin/Git/workstand-shop-app/src/lib/ui/TopNav.svelte:19:45)
    at Object.$$render (/Users/arlin/Git/workstand-shop-app/node_modules/svelte/src/runtime/internal/ssr.js:156:16)
    at Object.default (/Users/arlin/Git/workstand-shop-app/src/routes/(shop)/+layout.svelte:38:97)
    at eval (/Users/arlin/Git/workstand-shop-app/src/lib/ui/Header.svelte:15:72)
    at Object.$$render (/Users/arlin/Git/workstand-shop-app/node_modules/svelte/src/runtime/internal/ssr.js:156:16)
    at Object.header (/Users/arlin/Git/workstand-shop-app/src/routes/(shop)/+layout.svelte:30:95)
    at /Users/arlin/Git/workstand-shop-app/src/lib/ui/layouts/PageLayout.svelte:11:73
Error: Cannot subscribe to 'page' store on the server outside of a Svelte component, as it is bound to the current request via component context. This prevents state from leaking between users.For more information, see https://kit.svelte.dev/docs/state-management#avoid-shared-state-on-the-server
    at get_store (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/app/stores.js:89:9)
    at Object.subscribe (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/app/stores.js:35:37)
    at Module.subscribe (/Users/arlin/Git/workstand-shop-app/node_modules/svelte/src/runtime/internal/utils.js:139:22)
    at eval (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/components/error.svelte:13:45)
    at Object.$$render (/Users/arlin/Git/workstand-shop-app/node_modules/svelte/src/runtime/internal/ssr.js:156:16)
    at Object.default (/Users/arlin/Git/workstand-shop-app/.svelte-kit/generated/root.svelte:51:42)
    at eval (/Users/arlin/Git/workstand-shop-app/src/routes/+layout.svelte:11:41)
    at Object.$$render (/Users/arlin/Git/workstand-shop-app/node_modules/svelte/src/runtime/internal/ssr.js:156:16)
    at /Users/arlin/Git/workstand-shop-app/.svelte-kit/generated/root.svelte:45:40
    at $$render (/Users/arlin/Git/workstand-shop-app/node_modules/svelte/src/runtime/internal/ssr.js:156:16)
ClientResponseError 404: The requested resource wasn't found.
    at file:///Users/arlin/Git/workstand-shop-app/node_modules/pocketbase/dist/pocketbase.es.mjs:1:32313
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Module.find (/Users/arlin/Git/workstand-shop-app/src/lib/server/db/pocketbase/members.ts:10:18)
    at async load (/Users/arlin/Git/workstand-shop-app/src/routes/(shop)/+page.server.ts:13:18)
    at async Module.load_server_data (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/server/page/load_data.js:61:17)
    at async Promise.all (index 2)
    at async Module.render_data (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/server/data/index.js:99:17)
    at async resolve (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/server/respond.js:433:17)
    at async eval (/Users/arlin/Git/workstand-shop-app/src/lib/auth/pocketbase/pocketbase-auth.server.ts:52:10)
    at async Module.respond (/Users/arlin/Git/workstand-shop-app/node_modules/@sveltejs/kit/src/runtime/server/respond.js:319:20) {
  url: 'http://localhost:8090/api/collections/members/records?page=1&perPage=500&skipTotal=1',
  status: 404,
  response: {
    code: 404,
    message: "The requested resource wasn't found.",
    data: {}
  },
  isAbort: false,
  originalError: {
    url: 'http://localhost:8090/api/collections/members/records?page=1&perPage=500&skipTotal=1',
    status: 404,
    data: {
      code: 404,
      message: "The requested resource wasn't found.",
      data: {}
    }
  }
}
mikemitchel commented 3 months ago

Curious - did you use the npm run deploy script to build it? Also, did you happen to hard reload the browser? I'm wondering if it's a caching issue, as that branch is not drastically different from main which is up at our staging location. If it is a caching issue, I have an issue filed to fix that..

mikemitchel commented 3 months ago

sorry I was wrong, lots of new code since that readme-updates branch

mikemitchel commented 3 months ago

@FeXd I rebased this branch with the current main branch and added your changes as the last commit. It should be good to keep working here now.

mikemitchel commented 2 months ago

this has been resolved with updates