parser icon indicating copy to clipboard operation
parser copied to clipboard

TypeError: cheerio.load is not a function

Open sawanstack opened this issue 2 years ago • 0 comments

I have insalled both postlight parser and cheerio. In a parallel repository, both work fine.

I am using react and vite to create a chrome extension that needs to use this. cheerio works fine in my react component.

as soon as I call parser.parse, it gives me the error.

import cheerio from 'cheerio'; import Parser from '@postlight/parser';

const $ = cheerio.load(html); //Works

const data = await Parser.parse(document.location.href,{html}); //Error

vite.config.js import { defineConfig } from 'vite' import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], build: { minify:false, rollupOptions: { output: { entryFileNames: react/[name].js, chunkFileNames: react/[name].js, assetFileNames: react/[name].[ext], }, }, }, })

Current Behavior

Steps to Reproduce

Detailed Description

Possible Solution

sawanstack avatar Oct 24 '23 21:10 sawanstack