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

fix: /api/js endpoint to work on vercel #2242

Merged
merged 19 commits into from
Mar 19, 2024

Conversation

ShubhamPalriwala
Copy link
Contributor

@ShubhamPalriwala ShubhamPalriwala commented Mar 14, 2024

What does this PR do?

Makes the /api/js endpoint work on Vercel

Fixes # (issue)

How should this be tested?

  • Test A
  • Test B

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link

vercel bot commented Mar 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
formbricks-cloud ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 15, 2024 9:30am
formbricks-com 🛑 Canceled (Inspect) Mar 15, 2024 9:30am

Copy link
Contributor

github-actions bot commented Mar 14, 2024

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

apps/web/next.config.mjs

Consider using destructuring assignment for the 'path' module to make the code more readable and concise. This way, you won't need to repeat 'path.' every time you want to call a method from the 'path' module.
Create Issue
See the diff
Checkout the fix

    const { dirname, join } = require('path');
    const __dirname = dirname(fileURLToPath(import.meta.url));
    outputFileTracingRoot: join(__dirname, "../../"),
git fetch origin && git checkout -b ReviewBot/Impro-9g7uuq3 origin/ReviewBot/Impro-9g7uuq3

Consider storing the result of 'fileURLToPath(import.meta.url)' in a variable since it is used multiple times. This way, you avoid unnecessary function calls which can improve the performance of your code.
Create Issue
See the diff
Checkout the fix

    const filePath = fileURLToPath(import.meta.url);
    const jiti = createJiti(filePath);
    const __dirname = dirname(filePath);
git fetch origin && git checkout -b ReviewBot/Impro-aeu7wes origin/ReviewBot/Impro-aeu7wes

@vercel vercel bot temporarily deployed to Preview – formbricks-cloud March 15, 2024 09:03 Inactive
Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShubhamPalriwala thank you :-) looks good!

@mattinannt mattinannt added this pull request to the merge queue Mar 19, 2024
Merged via the queue into main with commit 4abe080 Mar 19, 2024
12 of 15 checks passed
@mattinannt mattinannt deleted the shubham/for-1992-make-js-endpoint-work-on-vercel branch March 19, 2024 09:51
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.

None yet

2 participants