Error when importing third-party libraries

Topic summary

A developer is encountering errors when trying to import two third-party Node.js libraries (got and jsdom) into their Shopify app’s frontend.

Installation:

  • Both libraries were installed using npm with workspace flags: npm install got --workspace="web/frontend" and npm install jsdom --workspace="web/frontend"

Errors encountered:

  • Uncaught TypeError: promisify4 is not a function
  • Uncaught TypeError: class EventEmitter inherit is not an object or null

Key question:
The developer is seeking help understanding why these errors occur and how to resolve them if possible.

Status: The issue remains unresolved with no responses yet. The errors suggest potential compatibility issues between Node.js libraries and the frontend environment, possibly related to browser vs. server-side module differences.

Summarized with AI on November 19. AI used: claude-sonnet-4-5-20250929.

Hello,

I’m trying to build an application for my store, and have created a new node application,

I have installed 2 libraries
npm install got --workspace=“web/frontend”
and
npm install jsdom --workspace=“web/frontend”

however, when I try to work with the libraries and import them on my app :

import got from "got";
import { JSDOM } from "jsdom";

I get errors saying

Uncaught TypeError: class heritage EventEmitter is not an object or null

or

Uncaught TypeError: promisify4 is not a function

Why does it do like this, and how we fix that if possible.

thank you.