Closed sebpowell closed 3 years ago
package.json
I'm trying to convert the 'require' syntax shown in the documentation to 'import', but not having any luck. Here's my code:
import createMetaScraper from 'metascraper'; import metascraperAuthor from 'metascraper-author'; const metascraper = createMetaScraper([metascraperAuthor()]);
This gives me the following error:
TypeError: (0 , metascraper_author_1.default) is not a function
Not sure where I'm going wrong? Any guidance would be greatly appreciated.
The library is using CJS, it's not ready for ESM.
I think it must be possible if you load https://github.com/standard-things/esm first.
@Kikobeats great, thanks!
Prerequisites
package.json
.Subject of the issue
I'm trying to convert the 'require' syntax shown in the documentation to 'import', but not having any luck. Here's my code:
This gives me the following error:
TypeError: (0 , metascraper_author_1.default) is not a function
Not sure where I'm going wrong? Any guidance would be greatly appreciated.