I have tried adding "type: module" to package.json but that does not work.
I have tried renaming the file extension to .mjs and .cjs but that does not work either.
I have switched my imports/require between the following:
import fetch from 'node-fetch';
import _metascraper from 'metascraper';
import url from 'metascraper-url';
import description from 'metascraper-description';
const metascraper = _metascraper([title(),description()]);
To using require:
const metascraper = require('metascraper')([
require('metascraper-description')(),
require('metascraper-title')()
])
The errors are either:
type: module to package.json