You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone,
I'm encountering an issue with importing a module from the lodash-es library in a project using Parcel bundler. I've reviewed the documentation and tried various approaches, but I'm still facing difficulties.
Problem Description:
I'm trying to import the cloneDeep function from the lodash-es library using the following import statement in my JavaScript file:
javascript
Copy code
import cloneDeep from './lodash-es/cloneDeep.js';
However, when I attempt to build my project with Parcel, I get the following error:
javasrcipt
Copy code
@parcel/core: Failed to resolve './lodash-es/cloneDeep.js' from './script.js'
Steps I've Taken:
I've verified that the lodash-es library is installed as a dependency in my project.
I've tried both the import statement with and without the .js extension.
I've attempted to clear the Parcel cache using npx parcel clean.
I've checked my Parcel configuration to ensure it's correctly set up.
I've considered the compatibility of package versions.
Now, here's the part that tickles my curiosity. I did try importing directly from node_modules and, well, it worked like a charm. But I'm on a mission to keep my imports pretty and clean. No offense to the node_modules party, of course!😁
Project Setup:
Parcel version: "leaflet": "^1.9.4",
lodash-es version: "lodash-es": "^4.17.21" My Question is:
Is there a specific configuration or approach that I might be missing? I'd greatly appreciate any insights or suggestions to help me resolve this issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone,
I'm encountering an issue with importing a module from the lodash-es library in a project using Parcel bundler. I've reviewed the documentation and tried various approaches, but I'm still facing difficulties.
Problem Description:
I'm trying to import the cloneDeep function from the lodash-es library using the following import statement in my JavaScript file:
javascript
Copy code
import cloneDeep from './lodash-es/cloneDeep.js';
However, when I attempt to build my project with Parcel, I get the following error:
javasrcipt
Copy code
@parcel/core: Failed to resolve './lodash-es/cloneDeep.js' from './script.js'
Steps I've Taken:
I've verified that the lodash-es library is installed as a dependency in my project.
I've tried both the import statement with and without the .js extension.
I've attempted to clear the Parcel cache using npx parcel clean.
I've checked my Parcel configuration to ensure it's correctly set up.
I've considered the compatibility of package versions.
Now, here's the part that tickles my curiosity. I did try importing directly from node_modules and, well, it worked like a charm. But I'm on a mission to keep my imports pretty and clean. No offense to the node_modules party, of course!😁
Project Setup:
Parcel version: "leaflet": "^1.9.4",
lodash-es version: "lodash-es": "^4.17.21"
My Question is:
Is there a specific configuration or approach that I might be missing? I'd greatly appreciate any insights or suggestions to help me resolve this issue.
Thank you in advance for your assistance!
Beta Was this translation helpful? Give feedback.
All reactions