Skip to content

Fix: standardize /obaSdk imports (remove .js extension) to avoid modu…#459

Open
raj-aryan-official wants to merge 1 commit intoOneBusAway:developfrom
raj-aryan-official:bugfix
Open

Fix: standardize /obaSdk imports (remove .js extension) to avoid modu…#459
raj-aryan-official wants to merge 1 commit intoOneBusAway:developfrom
raj-aryan-official:bugfix

Conversation

@raj-aryan-official
Copy link
Copy Markdown

Fixes #458

Short description of what this resolves:

This PR fixes server-side 500 errors caused by inconsistent module imports of the OBA SDK. Standardizing the import pattern ensures reliable module resolution during SSR.

Changes proposed in this pull request:

  • Fixed inconsistent imports of the OBA SDK across server-side files
  • Replaced usages of $lib/obaSdk.js with $lib/obaSdk to align with Vite/SvelteKit module resolution
  • Eliminated runtime import failures that were causing intermittent server 500 errors
  • Improved consistency and reliability of server-side code

Files updated:

  • src/lib/serverCache.js
  • src/routes/stops/[stopID]/+page.server.js
  • Multiple API route files under src/routes/api/oba///+server.js

Checklist

[x] I have read the Contribution & Best practices Guide
[x] My branch is up-to-date with the upstream branch
[x] Changes tested locally and server runs without errors
[ ] Tests can be added for further validation if required
[ ] Documentation updates can be added if needed

Additional Notes:

This change ensures consistent module resolution across the codebase and prevents SSR-related runtime failures. Happy to verify further or extend with tests if required.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Server-side 500 errors due to inconsistent OBA SDK imports

2 participants