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

Blog: Sample data does not load in serverless function? #471

Closed
EthanThatOneKid opened this issue May 15, 2022 · 0 comments · Fixed by #472
Closed

Blog: Sample data does not load in serverless function? #471

EthanThatOneKid opened this issue May 15, 2022 · 0 comments · Fixed by #472
Assignees
Labels
bug Something isn't working p1 2nd highest priority

Comments

@EthanThatOneKid
Copy link
Owner

What happened?

According to #419, we want to show a set amount of blog posts on /blog in certain environments (by setting VITE_DEBUG=1).

However in #468 (comment), @jaasonw discovered that the blog was misbehaving. This lead me to look into the realtime logs for the Vercel preview in question.

Logs

Screenshot:

image

Pasta 🍝:

[GET] /blog
12:31:03:08
Function Status:
500
Edge Status:
500
Duration:
5.62 ms
Init Duration:
N/A
Memory Used:
72 MB
ID:
sfo1::iad1::qj6rz-1652643063083-322fabb8e1b3
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
2022-05-15T19:31:03.132Z	200b2962-793d-4ab2-9c0d-be6088721981	ERROR	TypeError: Cannot read property 'length' of null
    at each (/var/task/index.js:5470:31)
    at /var/task/index.js:7023:72
    at Object.$$render (/var/task/index.js:5495:18)
    at Object.default (/var/task/index.js:37760:92)
    at /var/task/index.js:5914:67
    at Object.$$render (/var/task/index.js:5495:18)
    at /var/task/index.js:37754:97
    at $$render (/var/task/index.js:5495:18)
    at Object.render (/var/task/index.js:5503:20)
    at render_response (/var/task/index.js:38558:29)

Guesswork

I worry that this error may be a result of failing to load the sample posts from a JSON file (/acmcsuf.com/src/routes/blog/_testdata/posts.json) because according to Vercel.com, "At present, it is not possible to import files in a Next.js SSR page or function given this issue."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p1 2nd highest priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant