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 running on NodeJS v20 with ESM to compile this module into electron builder. got this error:
import cheerio from "cheerio"; // load is named export, so wrapping in a default import
^^^^^^^
SyntaxError: The requested module 'cheerio' does not provide an export named 'default'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:146:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:229:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
Node.js v20.17.0
when i using load import import { load } from 'cheerio' when i run test using jest is working, no error. But, when compiled using electron builder got error message like
TypeError: Cannot destructure property
it should be
import cheerio from 'cheerio';
const { load } = cheerio;
when i using default import below
importcheeriofrom'cheerio';// rest of codesconst$=cheerio.load('string html');
Error when using jest or direct nodejs run (node filename.js), but no error message showing on compiled electron (but the html parsing not working at all). here screenshoot.
how to fix this ?
The text was updated successfully, but these errors were encountered:
I'am running on NodeJS v20 with ESM to compile this module into electron builder. got this error:
import { load } from 'cheerio'
when i run test usingjest
is working, no error. But, when compiled using electron builder got error message likeError when using jest or direct nodejs run (node filename.js), but no error message showing on compiled electron (but the html parsing not working at all). here screenshoot.
how to fix this ?
The text was updated successfully, but these errors were encountered: