You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use this module and, I am getting the below error;
TypeError: gray_matter__WEBPACK_IMPORTED_MODULE_4__ is not a function
// codeimport*asmatterfrom"gray-matter";exportasyncfunctiongetAllFilesFrontMatter(type){constfiles=readdirSync(join(process.cwd(),"data",type));constposts=files.map((file)=>{constfileContents=readFileSync(join(process.cwd(),"data",type,file),"utf8");const{ data }=matter(file);<---throwsanerror});returnposts;}
What could be the issue here? I am using this function in a nextjs project, not sure if the issue is to do with webpack 5
The text was updated successfully, but these errors were encountered:
Hi there,
I am trying to use this module and, I am getting the below error;
What could be the issue here? I am using this function in a nextjs project, not sure if the issue is to do with webpack 5
The text was updated successfully, but these errors were encountered: