Next.js Discord

Discord Forum

Hello guys, here i have my project, it works without any issues in development but it fails build.

Unanswered
Kryp Arnold posted this in #help-forum
Open in Discord

5 Replies

Failed to compile.

171.js from Terser
  x await isn't allowed in non-async function
       ,-[32803:1]
 32803 | /* harmony import */ var unified__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12941);
 32804 | /* harmony import */ var rehype_parse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81032);
 32805 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([shiki__WEBPACK_IMPORTED_MODULE_0__]);
 32806 | shiki__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
       :                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 32807 | 
 32808 | 
       `----

Caused by:
    0: failed to parse input file
    1: Syntax Error
Error: 
  x await isn't allowed in non-async function
       ,-[32803:1]
 32803 | /* harmony import */ var unified__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12941);
 32804 | /* harmony import */ var rehype_parse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81032);
 32805 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([shiki__WEBPACK_IMPORTED_MODULE_0__]);
 32806 | shiki__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
       :                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 32807 | 
 32808 | 
       `----

Caused by:
    0: failed to parse input file
    1: Syntax Error


> Build failed because of webpack errors
the errors i got
Toyger
problem in your rehypePrettyCode
try to move everything that using it in separate file instead queries.tsx
or even better try it on empty project to understand does it work at all, maybe it have some problems with newer version of nextjs