我收到了这个错误
ERROR in ./bower_components/velocity/velocity.js
Module build failed: TypeError: /Users/dave/project/bower_components/velocity/velocity.js: Cannot read property 'length' of undefined
Run Code Online (Sandbox Code Playgroud)
(注意:所有类型的babel-core错误都会导致错误更长,但我认为这是因为某些内容无法正确加载Velocity)
我的Webpack别名:
Velocity: resolveBowerPath('/velocity/velocity.js')
Run Code Online (Sandbox Code Playgroud)
我的javascript导入:
import Velocity from 'Velocity';
Run Code Online (Sandbox Code Playgroud)
当我在终端中纳入该路径(/Users/dave/project/bower_components/velocity/velocity.js)时,该文件很好,所以它不是一个糟糕的导入URL,我能够很好地导入其他Bower项目,这个是唯一一个不会加载的人.有什么我做错了吗?
注意:当我尝试使用Velocity时,我遇到了同样的错误,webpack.ProvidePlugin()所以我认为这不是webpack的问题...
它出现了我已经设置了正确的方法,经过几个小时的阅读/尝试十几个关于设置虚拟主机的教程.基本上,在升级我的Ubuntu发行版(我知道,对吧?)后,Apache升级到2.4,一切都破了.在试图解决这个问题之后,我决定将一切都吹掉并重新开始.PHP/Apache是最新的.
我正在返回根索引("It Works!"),但不是我指定的DocumentRoot.
/etc/apache2/sites-available/domain.com.conf
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
# Indexes + Document Root
DirectoryIndex index.php index.html
DocumentRoot /var/www/domain.com/htdocs/
# Logging
ErrorLog /var/www/domain.com/logs/error.log
CustomLog /var/www/domain.com/logs/access.log combined
<Directory "/var/www/domain.com/htdocs/">
Options Indexes FollowSymLinks Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我输入了"sudo a2ensite domain.com.conf",它正如您所期望的那样显示在/ enabled-sites中.
apache2ctl -S
VirtualHost configuration:
*:80 is a NameVirtualHost
default server domain.com (/etc/apache2/sites-enabled/domain.com.conf:1)
port 80 namevhost domain.com (/etc/apache2/sites-enabled/domain.com.conf:1)
alias www.domain.com
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: …Run Code Online (Sandbox Code Playgroud)