How to deploy a web application Aurelia in an Apache server?

纵然是瞬间 提交于 2019-12-10 19:22:57

问题


To try, I used the latest "aurelia-skeleton-navigation 1.0.0-beta.1.0.1".

To deploy the Aurelia web application in an Apache server I used "gulp export" command and I copied the contents of the "export" in the "www/html/myapp" directory !

So, the welcome tab works fine, but not the "github users" tab !
The error is :

ERROR [app-router] Error: XHR error (404 Not Found) loading http://localhost/myapp/jspm_packages/github/github/fetch@0.10.1.js Error loading http://localhost/myapp/jspm_packages/github/github/fetch@0.10.1.js as "github:github/fetch@0.10.1" from http://localhost/myapp/dist/users.js Stack trace: o@http://localhost/myapp/jspm_packages/system.js:4:12750 e/http://localhost/myapp/jspm_packages/system.js:4:13275

what have I missed ?


回答1:


Based on the error message I can say that the fetch polyfill is missing from the exported folder.

To fix that, edit the file build/export.json. Replace the lines

"jspm_packages/github/github/fetch@0.9.0.js",
"jspm_packages/github/github/fetch@0.9.0/fetch.js"

with references to the correct version (0.10.1 in your case):

"jspm_packages/github/github/fetch@0.10.1.js",
"jspm_packages/github/github/fetch@0.10.1/fetch.js"

Then run the gulp export command again and make sure that fetch files are now copied into jspm_packages.

There is already a pull request to fix that.



来源:https://stackoverflow.com/questions/34000039/how-to-deploy-a-web-application-aurelia-in-an-apache-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!