Closed prateekjpr20 closed 11 months ago
Contentlayer will generate the parsed content files automatically, you should not delete it!
The Unknown file extension ".json"
error suggests that it is not reading it properly. Are you using a freshly cloned repository? And what's your node version? Try using a recent version of node 18+ if you are not already doing so.
I updated node and it solved the issue. thanks for such a fast support.
Describe the bug This bug is coming when I am using yarn build or npm run build.
Even if i deleted this file, this file gets created automatically. Attaching my files for better reference.
SuccessCallbackError { error: TypeError: Unknown file extension ".json" for /Users/Sonia/Documents/asi/.contentlayer/generated/Blog/_index.json at new NodeError (node:internal/errors:371:5) at Object.file: (node:internal/modules/esm/get_format:72:15) at defaultGetFormat (node:internal/modules/esm/get_format:85:38) at defaultLoad (node:internal/modules/esm/load:13:42) at ESMLoader.load (node:internal/modules/esm/loader:303:26) at ESMLoader.moduleProvider (node:internal/modules/esm/loader:230:58) at new ModuleJob (node:internal/modules/esm/module_job:63:26) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:244:11) at ModuleWrap. (node:internal/modules/esm/module_job:78:21)
at async Promise.all (index 1) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
},
_tag: 'SuccessCallbackError',
toString: [Function (anonymous)],
}, Archive.zip
Symbol(): [ 'error' ] }