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
Getting an error when trying to run the following hello world example, I get an error where the matter export is not a function.
Offending code:
import*asmatterfrom'gray-matter';console.log(matter('---\ntitle: Front Matter\n---\nThis is content.'));
Resulting error:
TypeError: matter is not a function
at file:///C:/path/to/index.js:13:13
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:28:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
When I edit the export line in grey-matter/index.js in node modules to display:
module.exports={matter};
I can then import and run the marked package like this just fine:
import{matter}from'gray-matter';console.log(matter('---\ntitle: Front Matter\n---\nThis is content.'));
Are node packages with "type":"module" not supported or is this behavior a bug?
The text was updated successfully, but these errors were encountered:
Getting an error when trying to run the following hello world example, I get an error where the
matter
export is not a function.Offending code:
Resulting error:
When I edit the export line in grey-matter/index.js in node modules to display:
I can then import and run the marked package like this just fine:
Are node packages with
"type":"module"
not supported or is this behavior a bug?The text was updated successfully, but these errors were encountered: