本文介绍了"无法读取不确定&QUOT的财产“的决心”;错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用SystemJS加载为previously编译成模块ES5。我有以下的错误,但我不知道如何跨preT的错误消息:
I try to use SystemJS to load modules that were previously compiled into ES5. I have the following error but I don't know how to interpret the error message:
Error: Cannot read property 'resolve' of undefined(…)
Promise.reject (async)
g @ system.src.js:4597(anonymous function) @ system.src.js:4597
y @ system.src.js:4597
w @ system.src.js:4597
p @ system.src.js:4597
h @ system.src.js:4597
(anonymous function) @ system.src.js:4597
下面是我的HTML文件中的配置:
Here is the configuration within my HTML file:
<script src="https://rawgithub.com/systemjs/systemjs/0.19.6/dist/system.js"></script>
(...)
<script>
System.config({
packages: {
somepackage: {
format: 'register',
defaultExtension: 'js'
},
src: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('src/somefile')
.then(null, console.error.bind(console));
</script>
有一些调试模式/踪迹我可以启用?
Is there some debug mode / traces I can enable?
我尝试使用Angular2的来源,而不是直接捆绑的JS文件。
I try to use the source of Angular2 directly instead of the bundled JS files.
非常感谢您的帮助!
蒂埃里
Thanks very much for your help!Thierry
推荐答案
让我们假设这是文件夹中的 node_modules 公开访问!
Lets assume that is folder node_modules publicly accessible!
如果是这样,你可以使用这个SystemJS配置文件:
If it is so, you can use this SystemJS config file:
System.config({
defaultJSExtensions: true,
map: {
"app": './src',
"angular2": 'node_modules/angular2',
'rxjs/operator/*' : 'node_modules/rxjs/add/operator/*',
"rxjs": 'node_modules/rxjs',
"reflect-metadata": 'node_modules/reflect-metadata/temp/Reflect.js',
"zone.js": 'node_modules/zone.js/dist/zone.js'
},
packages: {
app: {
defaultExtension: 'js',
format: 'register'
},
angular2: {
defaultExtension: 'js',
},
rxjs: {
defaultExtension: 'js'
},
'reflect-metadata': {
format: 'global'
}
}
});
这篇关于&QUOT;无法读取不确定&QUOT的财产“的决心”;错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!