atesgoral / acb

Adobe Photoshop Color Book (ACB) encoder and decoder
11 stars 1 forks source link

Package can't be imported in a Next.js context #4

Closed atesgoral closed 3 years ago

atesgoral commented 3 years ago

While using from a Next.js setup:

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: .../node_modules/@atesgoral/acb/index.js
require() of ES modules is not supported.
require() of .../node_modules/@atesgoral/acb/index.js from .../.next/server/pages/api/upload.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from .../node_modules/@atesgoral/acb/package.json.
atesgoral commented 3 years ago

Fixed by #6