brianleroux / tiny-json-http

:anchor: Minimalist HTTP client for JSON payloads.
172 stars 18 forks source link

'Cannot Find HTTP' #38

Closed SamKomesarook closed 1 year ago

SamKomesarook commented 1 year ago

Hi!

I am running node v19.1.0, and have installed your lib to be used in a Next.js project. It throws an error when imported into a page while running dev mode:

Error: Cannot find module 'http'

I am importing it as import tiny from "tiny-json-http"

Strangely, when used during a build for dynamic route loading, it works fine... I have tried removing node-modules and reinstalling, to no avail.

ryanblock commented 1 year ago

This is probably something related to Next and/or v19, or if you're bundling, that. http is a Node.js module. Try without Next and without bundling!