Open empz opened 3 years ago
Okay it seems we need to use NEXT_PUBLIC
environment variables. Although probably not a good idea to expose this to the browser. Or is it a requirement and doesn't impose any security risk?
Hey @empz sorry for the late response. Have you taken a look at the new approach using the new React SDK?
https://www.storyblok.com/tp/add-a-headless-cms-to-next-js-in-5-minutes
Trying to load the access token from an environment variable (as it should be from the beginning instead of hardcoding it), breaks the build.
Build throws the following error:
Looking into
.next/server/pages/404
or.next/server/pages/[[...slug]].js
we can see that something is messing up theprocess.env
call. Seems like autoprefixer or something. Although I thought that was for CSS only, why is it messing up this simple nodejs code? No idea.