#Next / Vercel / 404: Can't access new .js file

32 messages Β· Page 1 of 1 (latest)

quasi bobcat
plain quail
#

I think in app, we create file something like this
app/contact/page.js

quasi bobcat
#

Unfortunately not :/

small forge
#

I think you leaked your sendgrid api key. might wanna quickly revoke it.

quasi bobcat
#

Yes thanks, these are for testing purpose and thanks again for pointing this out πŸ™‚

quasi bobcat
#

Been testing multiple things for the last 2,30 without succeeding

#

the /api/contact doesnt simply return something and doesn't seem to be taken into account from Vercel functions

#

Ok finally found ... needed to create a pages/api/contact.js path

shell topaz
quasi bobcat
#

Hi Youssef, i did not anderstand the routing system provided above

#

Actually it is working with /pages/api/contact.js

#

I only need to make a contact form, the simplier the better, the sooner πŸ™‚

#

but happy to lean if you have clear instructions πŸ˜„

proper tree
# quasi bobcat Unfortunately not :/

he's right, you should create page.js file. that's the rule 😊 and no need tp pages folder anymore. app directory is reaplacement for pages directory and beside that you shoud enable app directory from next config

quasi bobcat
#

I'm sure he is right but i'm using Vercel and this simply doesnt work.

#

I dont see any heplful error in the logs to move forward usng app/contact/page.js.

#

Happy if you have the right solution.

#

Also, i can't find any explanation on how to make this line "import sendgrid from "@sendgrid/mail";"

#

I circle in many web pages but can't find the explanation on this could work within a serverless environnemnt.

proper tree
#

I couldn't open the repo from app, unfortunately I don't have access to laptop right now, so if you won't find out, I can help you after I guess 10 hours, feel free to dm πŸ‘

quasi bobcat
#

You mean 22h? (I'm from France btw)

#

I should be back between 22h30 and 23h many thanks for your help!

proper tree
#

No i mean after 10 hours 😁not 22, I'm familiar with military hours 😁

#

That's the why 😁

quasi bobcat
#

Ok so 10 hours from now? ^^

#

It is 6pm for me right now

proper tree
#

Maybe tomorrow morning?

quasi bobcat
#

It was private