Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

60
Views
Exported property gets hidden in dynamic import using webpack

In the latest webpack version (5+) when i try to use exported content of dynamic loaded module i can't see its property (got undefined) - the only way is to use module.default.method instead of module.method. I noticed that using file-saver library, but also reproduced it with simple module - i recreated the way saveAs function is exported in file-saver. Here is the problematic repo: https://github.com/snffquake/webpack_demo

With webpack 5+ both console.logs return undefineds and with webpack 4 i get functions as expected. I can't see any breaking changes in the webpack changelog that could cause that. Also, I am not sure if file-saver exports function in the right way, however it worked differently in the previous webpack versions. So the question is, is the correct behavior or am i doing something wrong?

5 months ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.