question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lodash imports in es/* no longer renamed to lodash-es in build output

See original GitHub issue

Describe the bug Yup v0.32.9 is producing build output errors in webpack for lodash imports.

ERROR in ../../../node_modules/yup/es/Condition.js 1:0-29
Module not found: Error: Can't resolve 'lodash/has' in '/home/circleci/repo/node_modules/yup/es'

The lodash imports in es build output used to be renamed to lodash-es, but in the latest release that is no longer the case.

To Reproduce

Install the latest version of yup from npm and build using webpack 5.

NOTE: if you do not provide a runnable reproduction the chances of getting feedback are significantly lower

Expected behavior Build should succeed

Platform (please complete the following information): N/A

Additional context None

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:12
  • Comments:5

github_iconTop GitHub Comments

12reactions
FBNitrocommented, Jun 7, 2021

Because of this issue, all of lodash is imported and my webpack bundle size has grown

5reactions
aoloocommented, Sep 18, 2021

@GreenGremlin Were you able to fix this? I am having that problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

import _ from 'lodash-es/lodash.js' used to work. Now it doesn't ...
EDIT: I tried using lodash with NodeJS instead of testing in a browser with Live Server, and it works fine using just the...
Read more >
How to use lodash-es using import in Node 14? · Issue #4800
I'm trying to use lodash-es in the latest Node 14, which has out of the box support for ES modules . This means...
Read more >
Lodash imports in es/* no longer renamed to lodash-es in build output
Describe the bug. Yup v0.32.9 is producing build output errors in webpack for lodash imports. ERROR in ../../../node_modules/yup/es/Condition.js 1:0-29 ...
Read more >
How to Import Lodash in your JavaScript Projects for Lowest ...
The Correct Way to Include Lodash · 1. Import the entire lodash library · 2. Import using named aliases · 3. Import specific...
Read more >
The Correct Way to Import Lodash Libraries: A Benchmark
Importing Lodash libraries doesn't need to be daunting. Get insights into the top three ways to import Lodash functions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found