imgly / background-removal-js

Remove backgrounds from images directly in the browser environment with ease and no additional costs or privacy concerns. Explore an interactive demo.
https://img.ly/showcases/cesdk/web/background-removal/web
GNU Affero General Public License v3.0
5.7k stars 357 forks source link

error importing memoize from lodash #70

Closed NicholasThierolf closed 9 months ago

NicholasThierolf commented 10 months ago

I am getting the following Error in @imgly/background-removal-node/dist/index.mjs:390

import { memoize } from "lodash";
         ^^^^^^^
SyntaxError: Named export 'memoize' not found. The requested module 'lodash' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'lodash';
const { memoize } = pkg;

I am using it in an es modules context, when running a file from the command line (node filename)

dannya commented 10 months ago

I'm having the same issue, when importing the module via:

import { removeBackground } from '@imgly/background-removal-node';

on Node v16.16.0

Rhys-Yakkr commented 10 months ago

Same issue for me - Node version 18.17.0. Replacing the named import with the suggested import in the specified file did resolve the issue for me.

DanielHauschildt commented 9 months ago

Does it work for you now?

NicholasThierolf commented 9 months ago

Yes, works now in 1.3.0. Thanks! 👍