- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用 dojo (ArcGIS) AMD 加载器加载 qwest.js
,但收到 multipleDefine
错误。
require([
// `../vendor/react/react.js`, // this works fine
`../vendor/qwest/qwest.min.js`, // this causes error
], (
// React,
qwest,
) => { ... })
起初我以为这是因为我将它作为包添加到 dojo 配置对象中,但这样做会引发完全相同的错误。
配置:
require({
async: true
, parseOnLoad: true
, packages: [{
name: `app`
, location: `${location.pathname}js`
, main: `main`
}]
}, [`app`])
最佳答案
我真的不知道为什么会出现该错误,但您可以通过让 qwest
认为应该使用 commonjs 而不是 amd 来解决它:
//for testing purpose
require({
packages: [{ name: 'pyrsmk', location: 'https://rawgit.com/pyrsmk'}]
});
//the trick is to let qwest think you use commonjs instead of amd
window.module = {};
require(['pyrsmk/qwest/master/build/qwest.min'], function(qwest) {
qwest = module.exports;
delete window.module;
console.log(qwest);
});
<script src="https://rawgit.com/dojo/dojo/1.10/dojo.js"></script>
关于javascript - dojo:qwest.js 的 multipleDefine 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31975069/
我尝试使用 dojo (ArcGIS) AMD 加载器加载 qwest.js,但收到 multipleDefine 错误。 require([ // `../vendor/react/react.
我的 dojo 应用程序在构建后、加载应用程序期间中断,抛出“multipleDefine”并给出此错误: Error {src: "dojoLoader", info: Object} 消息:mul
我希望在我的 ArcGIS Web 应用程序中包含某人编写的组件。 但是,当我包含时,我总是在控制台窗口中遇到 multipleDefine 问题。 有两种方法可以解决这个问题,那就是把下面的脚本移到
我正在尝试创建一个可编辑的 SlickGrid(使用 jquery-ui)并使用 Dojo。 当我的页面包含控制台显示 Error: multipleDefine return mix(new Err
这个问题之前已经回答过很多次,我知道一种解决方案是简单地更改它,以便 (Esri)dojo 是最后一个加载的。 问题是我正在开发一个模块化小部件,它无法访问页面的 html 来更改顺序,我必须只能通过
我是一名优秀的程序员,十分优秀!