require

TypeError: Router.use() requires middleware function but got a Object

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There have been some middleware changes on the new version of express and I have made some changes in my code around some of the other posts on this issue but I can't get anything to stick. We had it working before hand but I can't remember what the change was. throw new TypeError('Router.use() requires middleware function but got a ^ TypeError: Router.use() requires middleware function but got a Object node ./bin/www js-bson: Failed to load c++ bson extension, using pure JS version js-bson: Failed to load c++ bson extension, using pure JS

Sessions won't save in Node.js without req.session.save()

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm building a website using Node.js, Express, and Redis for session management. For whatever reason, if I have a session variable ( isLoggedIn in this example), and I refresh the page, the variable doesn't get saved, however, if I call req.session.save() after setting the variable, it does get saved to Redis (redis-cli monitor shows this - not calling save() shows that the variable isn't there, whereas calling save() shows it). I'm using this to set up and start the server: var express = require('express'); var path = require('path'); var

How to allow for webpack-dev-server to allow entry points from react-router

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm creating an app that uses webpack-dev-server in development alongside react-router. It seems that webpack-dev-server is built around the assumption that you will have a public entry point at one place (i.e. "/"), whereas react-router allows for an unlimited amount of entry points. I want the benefits of the webpack-dev-server, especially the hot reloading feature that is great for productivity, but I still want to be able to load routes set in react-router. How could one implement it such that they work together? Could you run an express

Require statement in application.css.scss

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to use a lightbox gem such as fancybox or color box. Both gems ask to add this line in the application.css *= require colorbox - rails Here's the problem. I only have application.css.scss files. All my css files are scss files. I have import statements in the application.css.scss but no *=require statements. Adding the above line results in the error : Invalid CSS after "*": expected "{", was "=require colorb..." Here's the complete application.css.scss @import "bootstrap" ; @import "welcome" ; @import "sessions" ; @import

Bootstrap 3 dropdown doesn't work with Rails 4 & Turbolinks

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I recently upgraded my site to Bootstrap 3 and am in the process of going through all the layouts to update class names and various functionality to work correctly. My most recent problem is that drop downs don't seem to be working. At first I thought I hadn't implemented the code correctly for my nav bar, but after getting frustrated, I actually tried just getting rid of my nav bar and using the one straight out of the BS 3 documentation . Even that code doesn't work. I've looked into this, and I'm fairly certain I have all the proper .js

Ruby require 'tk' yields LoadError: no such file to load ― tk

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm not able to get ruby to require 'tk' successfully. I'm using rvm, ruby 2.0.0, ActiveTcl-8.6, and Ubuntu 12.04 LTS. I have run wish provided with ActiveTcl and it seems to be working. I've looked on the RVM site http://rvm.io/integration/tk and several StackOverflow questions like this one RVM Ruby with TK installation (OSX) . I have tried rvm reinstall 2.0.0 --enable-shared --enable-pthread --with-tk --with-tcl several times on different versions of ruby with no success. Any thoughts? When I run irb and do require'tk' I get the following

Using Bootstrap 3.0 with Browserify

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to use Bootstrap 3.0 with Browserify 5.9.1, but getting the following error: Uncaught ReferenceError : jQuery is not defined What's the correct way to do this? Here are the relavant portions of my package.json: { ... "scripts" : { "bundle" : "browserify main.js -o bundle.js --debug --list" }, "dependencies" : { "backbone" : "~1.1.x" , "jquery" : "~2.1.x" , "underscore" : "~1.6.x" }, "devDependencies" : { "browserify" : "^5.9.1" , ... }, ... } The module that requires bootstrap is shown below: var $ = require ( 'jquery'

Error: Class 'Facebook\\FacebookSession' not found with the facebook PHP SDK

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am having a hard time with facebook's SDK documentation. I downloaded the SDK from Github and added it into my PHP project. Here is the file system: here is my code so far: use Facebook\FacebookSession; use Facebook\FacebookRequest; use Facebook\GraphUser; use Facebook\FacebookRequestException; FacebookSession::setDefaultApplication('*******','******'); $helper = new FacebookRedirectLoginHelper('http://isgeek.eu/fb/FaRepost/return.php'); $loginUrl = $helper->getLoginUrl(); // Use the login url on a link or button to redirect to Facebook

Javascript not working - changing image to text on click

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've asked a question recently on how to change 2 icons to text on click. The solution worked for a while, but now it's not working. Is there another way to do it or is the problem in the code? I face the problem with other scripts very often. application.js //= require jquery //= require jquery_ujs //= require bootstrap //= require jquery.ui.all //= require jquery.turbolinks //= require jquery_nested_form //= require_tree . show.html.erb true %> true %> html output icons.js $('.thumbsdown a, .thumbsup a').on('click', function() { $('

ReferenceError: Can't find variable: require at

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a question about using jasmine with Grunt. I keep getting an error, ReferenceError: Can't find variable: require at whenever I run my jasmine tests. Here is my jasmine entry for my Gruntfile.js : jasmine: { js: { src: jsFiles, options: { specs: 'tests/*_spec.js', helpers: 'tests/helpers/*', vendor: 'vendor/*' } } }, I can run a dummy test without a require just fine, but when I include a require in a test, like so, I get the require error. var testD = require('../src/events_to_actions'); describe("events_to_actions", function() { it(