Build error NextJS 14.1 parseEnvironment() error
Answered
Kapatid posted this in #help-forum
KapatidOP
My SST + NextJS apps keeps getting this error:
The thing is I don't even have this codes in my
Attached in this post is my dependencies. I have also tried only running
../app/[locale]/(app-pages)/genai/gallery/page.js from Terser
x await isn't allowed in non-async function
,-[46332:1]
46332 | // }
46333 | // }
46334 | // }
46335 | const allVariables = await parseEnvironment();
: ^^^^^^^^^^^^^^^^
46336 | function createProxy(constructName) {
46337 | const result = new Proxy({}, {
46338 | get (target, prop) {
`----
Caused by:
0: failed to parse input file
1: Syntax Error
Error:
x await isn't allowed in non-async function
,-[46332:1]
46332 | // }
46333 | // }
46334 | // }
46335 | const allVariables = await parseEnvironment();
: ^^^^^^^^^^^^^^^^
46336 | function createProxy(constructName) {
46337 | const result = new Proxy({}, {
46338 | get (target, prop) {
`----
Caused by:
0: failed to parse input file
1: Syntax Error
> Build failed because of webpack errors
The thing is I don't even have this codes in my
page.tsx
and I don't have any async
functions in it or nextjs actions.Attached in this post is my dependencies. I have also tried only running
npx next build
without sst bind
but it gives the same error. Also, npm run dev
works fine. Does anyone know the problem?Answered by Kapatid
I found a solution but its not really clean...
https://github.com/vercel/next.js/issues/54282#issuecomment-1880221357
https://github.com/vercel/next.js/issues/54282#issuecomment-1880221357
1 Reply
KapatidOP
I found a solution but its not really clean...
https://github.com/vercel/next.js/issues/54282#issuecomment-1880221357
https://github.com/vercel/next.js/issues/54282#issuecomment-1880221357
Answer