Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

962
Views
Angular - Error with cheerio package? "You may need an additional loader to handle the result of these loaders"

I am suddenly facing this issue that seemingly came out of nowhere. The project I am working on in my company is rather large and we are using a micro frontend architecture. I was working in one branch yesterday and after building and pushing my code, I checked out to another branch to check something and then went back to the original branch I was in. After trying to serve the application again, I was faced with this error. It seems everyone else on the team is getting this error, too. Even those who haven't pulled the code I pushed.

Here is the error:

Error: ./node_modules/cheerio/node_modules/htmlparser2/lib/esm/index.js 59:9 Module parse failed: Unexpected token (59:9) File was processed with these loaders:

  • ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
  • ./node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/ivy/index.js You may need an additional loader to handle the result of these loaders. | return getFeed(parseDOM(feed, options)); | }

export * as DomUtils from "domutils"; | // Old name for DomHandler | export { DomHandler as DefaultHandler };

Error: ./node_modules/cheerio/node_modules/parse5/dist/index.js 6:9 Module parse failed: Unexpected token (6:9) File was processed with these loaders:

  • ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
  • ./node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/ivy/index.js You may need an additional loader to handle the result of these loaders. | export { serialize, serializeOuter } from './serializer/index.js'; | /** @internal */

export * as foreignContent from './common/foreign-content.js'; | /** @internal */ | export * as html from './common/html.js';

I've tried:

  • updating cheerio
  • deleting node_modules and package-lock, then running npm i
  • deleting cheerio
  • reverting back to before I pushed my code

Really not sure what else to do. This is my first stack overflow question so sorry if I'm missing any necessary info.

EDIT: I found two links on github

https://github.com/umijs/umi/issues/8109

https://github.com/cheeriojs/cheerio/issues/2545

and after following their instructions, I added cheerio to dev dependencies in package.json and then installed the 'stream' package. The error is resolved for the time being.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!