Closed jachsu closed 1 month ago
Unfortunately this seems to be an issue with one of the dependencies of Eslint. See the following posts for more context - https://github.com/ajv-validator/ajv/issues/2343 and https://github.com/garycourt/uri-js/pull/95. You can use node 18 / 20 or override uri-js
as suggested in the other posts.
I will update the dev dependencies when the underlying packages are updated.
It seems to be caused by the fact that assert
is not supported in higher versions of Node.js. As the official documentation says: This feature was previously named "Import assertions", and using the assert
keyword instead of with
. Any uses in code of the prior assert
keyword should be updated to use with
instead. https://nodejs.org/docs/latest-v22.x/api/esm.html#import-attributes
This solved the issue
After reinstalling the node@18, the issue get solved and everything works fine.
I can confirm @Saugatkafley, this worked for me too. Nasty bug got me walking around my whole blog posts database. Thank you for the fix.
The issue: Running
yarn build
gives ▲ Next.js 14.0.3(node:86224) [DEP0040] DeprecationWarning: The
punycode
module is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...
to show where the warning was created)SuccessCallbackError { error: SyntaxError: Unexpected identifier 'assert' at compileSourceTextModule (node:internal/modules/esm/utils:337:16) at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:163:18) at callTranslator (node:internal/modules/esm/loader:430:14) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:436:30) at ModuleJob._link (node:internal/modules/esm/module_job:106:19), _tag: 'SuccessCallbackError', toString: [Function (anonymous)],
}, Symbol(): [ 'error' ] } Creating an optimized production build .%
After reinstalling the node@18, the issue get solved and everything works fine.