:wave: `Install the @sls-next/lambda-at-edge packa...
# help
k
👋
Install the @sls-next/lambda-at-edge package by running the following in the project root.
sst project root or /frontend project root? This dep also does not exist in example repo: https://serverless-stack.com/examples/how-to-create-a-nextjs-app-with-serverless.html
if I add this to my sst package.json and run dev I get an error
a
hmmm, maybe this is the error I also had...what does the error message say?
k
Some nonsense like useContext is not a function
a
Have you done an npm install in the frontend folder?
i mean useContext is from react, so I guess it should be able to find it if you have
k
That's the weird thing, just take this example project, add
@sls-next/lambda-at-edge
and suddenly its gets broken
can't run yarn dev
a
were you in the frontend dir when you added it?
because the tut says you have to do it from the project root, not the frontend
i'm gonna try it as well
can't hurt to give it another try, maybe something was fixed
Nah, I still get the same problem I had before, that it can't deploy the lambda@edge stuff
does npm start from the project root work for you? It fails for me, it takes forever, then rolls back the deployment
ah, no, wait, it finished
now let's try to start the frontend...i think here is the lambda@edge stuff
hmmm, no, it seems to work now
maybe it only failed in prod deployment, I don't remember, let me check my old thread
so yeah, it works for me, not sure. Try cloning this and see if it works for you: https://github.com/adsc/sst-nextjs/tree/master
prod deploy also works
k
@Adrian Schweizer I have moved
"@serverless-stack/static-site-env": "^1.2.25"
from devDependancies to dependencies in /frontend and it's worky