Git Product home page Git Product logo

Comments (3)

bronius avatar bronius commented on May 27, 2024 4

I am not familiar/experienced enough to contribute to this issue, but I can share that the standard (non-ES6) way of using the module is still viable:

import lodash from 'lodash';
import deepdash from 'deepdash';
...
const _ = deepdash(lodash);
...
const result = _.filterDeep(_.merge( ... ));
...

hth

Update:
I stand corrected. This is well and good in development (we are using Typescript), but when I transpile with babel:

const lodashDeep = deepdash(lodash);

becomes:

const lodashDeep = (0, _deepdash.default)(deepdash.placeholder);

in compiled .js, and at runtime I get this error:

ReferenceError: deepdash is not defined

Update 2 (and simple resolution):
A coworker pointed out that my babel config had the plugin babel-plugin-lodash declared and that by removing it from babel config, the build included deepdash again. I haven't dug down to learn more, but I think I understand enough to know I have hijack OP's #116. I hope you still find this useful.

from deepdash.

yannvr avatar yannvr commented on May 27, 2024 2

I've got a similar issue when running the test with Jest (24.9.0) using either of those import statements

    ./node_modules/deepdash/es/eachDeep.js:2
    import deps from './deps/eachDeep.js';
    ^^^^^^

    SyntaxError: Cannot use import statement outside a module

from deepdash.

homerjam avatar homerjam commented on May 27, 2024

Furthermore...

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /node_modules/lodash-es/lodash.js
require() of ES modules is not supported.
require() of /node_modules/lodash-es/lodash.js from /utils/seed.ts 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 lodash.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /node_modules/lodash-es/package.json.

from deepdash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.