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.

Webpack 5 fails due to the way CAF is imported

See original GitHub issue

There is a conflict in the way how CAF is imported on upgrade from Webpack 4 -> 5.

In TaskInstance.ts the current import CAF from "caf"; works with Webpack 4, but crashes on Webpack 5. For Webpack 5 the code that works is import { CAF } from "caf";.

Edit : I actually can’t check if the stricter import that works in Webpack 5 is working on v4 too or not. If it is - then it is an easy fix.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:46 (20 by maintainers)

github_iconTop GitHub Comments

6reactions
lllopocommented, Jan 31, 2022

@MartinMalinda I’ll try to put my 5 cents on this again (feel free to correct me if I’m wrong and sorry in advance, if I’m talking nonsense). If you look at CAF’s package.json, the default export defined there is : ".": { "import": "./dist/esm/index.mjs", "default": "./index.js" }

So, when you do import whatever-you-want-to -import from "caf", this comes from ./dist/esm/index.mjs, which looks like this : export{default as CAF}from"./caf.mjs";export{default as CAG}from"./cag.mjs";export{default as CAFShared}from"./shared.mjs";

This means you there is no default export in this file to use and as far as I understand it - you should import like this import { CAF } from "caf". On other hand import CAF from "caf/caf" would come from ./dist/esm/caf.mjs where the module.exports you mention happens.

3reactions
MartinMalindacommented, Jul 5, 2022

Sorry for the delay everybody. I’ll double check the situation again this week, hopefully a new compromise has appeared and if not, I’ll release different versions for different platforms and let you know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 5 entry point now failing on imports - Stack Overflow
Issue. I've check your configuration and found out the issue is importing a .vue file ( App.vue ) into your js file (...
Read more >
Compilation errors when building with webpack 5 #24 - GitHub
We are now trying to migrate our projects to Webpack 5 and we have experienced the following kind of errors: ERROR in ./node_modules/react- ......
Read more >
Documentation Archive - Apple Developer
Title Resource Type Technology Date Xcode Release Notes Release Notes 2018‑06... Apple File System Guide Guides 2018‑06... Understanding and Detecting OpenGL Functionality Technical Notes OpenGL 2018‑06......
Read more >
howler - npm
Description. howler.js is an audio library for the modern web. It defaults to Web Audio API and falls back to HTML5 Audio.
Read more >
EJd - River Thames Conditions - Environment Agency - GOV.UK
Starbucks 348th federal way, Digitaler telefonanschluss telekom, ... User manual for samsung galaxy note 5, On nes aimera, Super bowl beyonce minus one, ......
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