gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 20:57:31 24 4
gpt4 key购买 nike

我最近开始学习 Agunlar JS,我正在学习一些关于如何使用 Visual Studio 启动 Agunlar JS 项目的教程。在某些时候,我遇到了一些包安装的 javascript 文件 (polyfill.js) 中未定义的“exports”变量的错误。我不知道此文件的用途,但我认为这是必要的。

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

在上面的代码中,导出为空。谁知道应该由谁生成“exports”对象?是否需要运行 Angular JS 应用程序?这个库/代码的目的是什么?

最佳答案

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?

它用于模块。此代码可以在 nodejs 中自然运行,但要在浏览器中运行它,您需要像 webpack 这样的模块加载器。

更多

关于javascript - Uncaught ReferenceError : exports is not defined at polyfills. js:17,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47497586/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com