Bonomi
Bonomi

Reputation: 2743

Uncaught ReferenceError: exports is not defined at polyfills.js:17

I started to learn Agunlar JS recently and I am following some tutorial on how to start a Agunlar JS project using Visual Studio. At some point I got stuck with an error of an undefined "exports" variable in one of the javascript files (polyfill.js) that was installed by some package. I don't know the purpose of this file but I assume it will be necessary.

Object.defineProperty(exports, "__esModule", { value: true });

In the above code, the exports is null. Anyone knows who should be generating the "exports" object? Is it necessary to run an Angular JS app? What's the purpose of this lib/code?

Upvotes: 1

Views: 302

Answers (1)

basarat
basarat

Reputation: 275957

Anyone knows who should be generating the "exports" object? Is it necessary to run an Angular JS app? What's the purpose of this lib/code?

It is used for modules. This code can run nativlely in nodejs but to run it in the browser you need a module loader like webpack.

More

Upvotes: 1

Related Questions