I'm trying to import contentful.js with import * as contentful from 'contentful'; in Remix but getting the error below. I'm doing this import in server.ts in order to add the contentful client to the loader context. contentful.js package.json specifies "main" and "browser" entries for built assets but I'm not sure why remix seems to be importing/bundling the browser version. This is remix v1.19.1 and contentful.js v^10.4.2.
Error: Adapter 'http' is not available in the build at /Users/sambooka/work/epic-repos/wasabi/node_modules/contentful/dist/contentful.browser.min.js:1:27782 at Le.Ee3 (/Users/sambooka/work/epic-repos/wasabi/node_modules/contentful/dist/contentful.browser.min.js:1:27961) at processTicksAndRejections (node:internal/process/task_queues:95:5) at i8 (/Users/sambooka/work/epic-repos/wasabi/node_modules/contentful/dist/contentful.browser.min.js:1:51678) at s16 (/Users/sambooka/work/epic-repos/wasabi/node_modules/contentful/dist/contentful.browser.min.js:1:51815) at o14 (/Users/sambooka/work/epic-repos/wasabi/node_modules/contentful/dist/contentful.browser.min.js:1:53980) at loader (/Users/sambooka/work/epic-repos/wasabi/app/root.tsx:57:17) at callRouteLoaderRR (/Users/sambooka/work/epic-repos/wasabi/node_modules/@remix-run/server-runtime/dist/esm/data.js:48:16) at callLoaderOrAction (/Users/sambooka/work/epic-repos/wasabi/node_modules/@remix-run/router/router.ts:3671:16) at async Promise.all (index 0)