Answer the question
In order to leave comments, you need to log in
Can't see connected module from node_modules. Why?
Hello.
1 - Installed npm module XXX
2 - I include it import XXX from ''XXX';
and when I try to call the initialization of new XXX(), it writes "__WEBPACK_IMPORTED_MODULE_4___default.a is not a constructor",
I print to the console what I have in principle in XXX, and there is an empty object {}
In the docks, there are no words about such a case. What could be the problem?
Answer the question
In order to leave comments, you need to log in
Modules may not have default exports. For example, let's say we have a module like this:
// Some module
const a = 1;
const b = 2;
export {
a,
b
}
import * as module from 'module';
console.log(module); // {a: 1, b: 2}
import { a } from 'module';
console.log(a); // 1
import { a, b } from 'module';
console.log(a); // 1
console.log(b); // 2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question