应用程序的基础无法加载 js 和 css 文件
foundation for apps can't load js and css files
我成功安装了应用程序依赖项的所有基础,包括 ruby、nodejs、git、scss 和所有内容。
但是,加载其属性时似乎有问题。
它显示下面的屏幕(没有模板,css,和 js)
什么时候应该显示下面的那个
从chrome和ie控制台来看,很明显是我本地设置的问题。
有谁知道如何解决这一问题?
下面是我的 chrome 控制台错误,我得到了 运行 欢迎模板。
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8080/assets/js/angular.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
foundation.js:21 Uncaught TypeError: Cannot read property 'replace' of null
http://localhost:8080/assets/css/app.css Failed to load resource: the server responded with a status of 404 (Not Found)
通过 运行 gulp 任务启动您的应用程序后,将在您的项目中生成一个名为 build
的文件夹,其中包含 assets
文件夹和导航器加载失败的所有必需文件。
进去看看,如果没有找到可能是安装或配置问题。这种情况最好重新安装一下
但如果一切如常,则可能是端口冲突问题,您计算机中的其他应用程序可能正在使用 http://localhost:8080,在这种情况下,您需要打开 gulpfile.js
并转到启动测试服务器的行:
// Starts a test server, which you can view at http://localhost:8080
gulp.task('server', ['build'], function() {
gulp.src('./build')
.pipe($.webserver({
port: 8080,
host: 'localhost',
fallback: 'index.html',
livereload: true,
open: true
}))
;
});
将 port: 8080
更改为 port: 8081
或任何其他内容,重新启动您的 gulp 任务以重新创建新服务器,如果新端口可用,它将工作 http://localhost:8081
.
我遇到了完全相同的问题,事实证明,始终打开以呈现我的 PHP 文件的 Apache 服务器正在使用该端口 :8080
。
我成功安装了应用程序依赖项的所有基础,包括 ruby、nodejs、git、scss 和所有内容。
但是,加载其属性时似乎有问题。
它显示下面的屏幕(没有模板,css,和 js)
什么时候应该显示下面的那个
从chrome和ie控制台来看,很明显是我本地设置的问题。 有谁知道如何解决这一问题?
下面是我的 chrome 控制台错误,我得到了 运行 欢迎模板。
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/assets/js/angular.min.js Failed to load resource: the server responded with a status of 404 (Not Found) foundation.js:21 Uncaught TypeError: Cannot read property 'replace' of null http://localhost:8080/assets/css/app.css Failed to load resource: the server responded with a status of 404 (Not Found)
通过 运行 gulp 任务启动您的应用程序后,将在您的项目中生成一个名为 build
的文件夹,其中包含 assets
文件夹和导航器加载失败的所有必需文件。
进去看看,如果没有找到可能是安装或配置问题。这种情况最好重新安装一下
但如果一切如常,则可能是端口冲突问题,您计算机中的其他应用程序可能正在使用 http://localhost:8080,在这种情况下,您需要打开 gulpfile.js
并转到启动测试服务器的行:
// Starts a test server, which you can view at http://localhost:8080
gulp.task('server', ['build'], function() {
gulp.src('./build')
.pipe($.webserver({
port: 8080,
host: 'localhost',
fallback: 'index.html',
livereload: true,
open: true
}))
;
});
将 port: 8080
更改为 port: 8081
或任何其他内容,重新启动您的 gulp 任务以重新创建新服务器,如果新端口可用,它将工作 http://localhost:8081
.
我遇到了完全相同的问题,事实证明,始终打开以呈现我的 PHP 文件的 Apache 服务器正在使用该端口 :8080
。