require

require('react-native').NativeModules is an empty object

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In one of the node_modules that I'm using in my project at the top of the file it says: let RNRandomBytes = require('react-native').NativeModules.RNRandomBytes Unfortunately, it appears that require('react-native').NativeModules is an empty object {}. How can I proceed from here? The package that I'm trying to use is: 'react-native-secure-randombytes'. If anyone has experience with this I'd really appreciate it. Thanks 回答1: You can use this way may be it help you import {NativeModules} from 'react-native'; 回答2: I would do this instead let

Uncaught ReferenceError: require is not defined

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to get the video uploader to work on my server i have node install on my server as root. i have installed the following in the folder where my node js file is cd /assets/js npm install socket.io npm install requirejs Then i run the node file with ]# node uploader.js info - socket.io started debug - served static content /socket.io.js and here is my uploader.js var app = require('http').createServer(handler) , io = require('socket.io').listen(app) , fs = require('fs') , exec = require('child_process').exec , util = require('util')

Running gunjs with Reactjs and webpack throws Reference Error in console

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to install gun.js and run it inside a Reactjs webpack bundled app var path = require('path'), webpack = require('webpack'); module.exports = { devtool: 'source-map', target: 'node', node: { fs: 'empty' }, entry: { workboard: './src/workboard/main.js' }, output: { path: __dirname, filename: '/public/[name]/js/bundle.js' }, module: { loaders: [ { test: /.js?$/, loader: 'babel-loader', exclude: /node_modules/, query: { presets: ['es2015', 'react', 'stage-2', 'stage-1'] } } ], noParse: [/aws-sdk/] }, plugins: [ new webpack

gulp : browserify then concat files

匿名 (未验证) 提交于 2019-12-03 00:54:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to browserify a file, and then to concat the bundle with another file. I tried the gulp code below but it's not working properly. When I make changes in mymodule.js and run gulp, those changes appear in the bundle file but not in the concatenated file, unless I run gulp a second time. It's like if the concat step is not waiting for the bundle step to finish and take the previously browserified bundle. As I'm a beginner with gulp, I'm sure there is something wrong with my gulp logic... My gulpfile is : var gulp = require('gulp'); var

Using Bootstrap gem with Rails

匿名 (未验证) 提交于 2019-12-03 00:53:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a fresh rails project where I only generated a controller. I've followed the directions to install bootstrap according to the bootstrap gem, and I keep getting the following error: ActionView::Template::Error (identifier '(function(opts, pluginOpts) {return eva l(process' undefined): 5: <%= csrf_meta_tags %> 6: <%= csp_meta_tag %> 7: 8: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbol inks-track': 'reload' %> 9: <%= javascript_include_tag 'application', 'data-turbolinks-track': ' reload' %> 10: </head> 11: (execjs):1

Use fullcalendar with webpack

匿名 (未验证) 提交于 2019-12-03 00:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use npm, webpack and FullCalendar, but I get the following error in the browser console when using fullcalendar: main.js:37556 Uncaught TypeError: (0 , _jquery2.default)(...).fullCalendar is not a function How do I fix this? I use FullCalendar 3.0.0-beta and jquery 3.1.0. My code is below. index.js: import $ from 'jquery' import jQueryUI from 'jquery-ui' import moment from 'moment' import fullCalendar from 'fullcalendar' $('#timetable').fullCalendar({ editable: true, firstDay: 1, droppable: true, }) webpack.config.js: var path = require(

Using async/await with babel - require(“babel-polyfill”) line not at the top in built file

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use ES2017 async/await syntax with Babel. In package.json , I have "babel": { "plugins": [ "babel-plugin-transform-async-to-generator" ], "presets": [ "es2015" ] } //... "devDependencies": { "babel-cli": "^6.14.0", "babel-plugin-transform-async-to-generator": "^6.8.0", "babel-polyfill": "^6.13.0", "babel-preset-es2015": "^6.14.0" } The code I am trying to work with is src/index.js require("babel-polyfill"); async function foo() { return 10; } and my built file is dist/build.js "use strict"; var foo = function () { var _ref =

DOMPDF - Class 'Font' not found

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to add a font via Command line. Every time I try i get the following error. Fatal error : Class 'Font' not found in / home / scripts / public_html / MarketingPalv2 / load_font . php on line 139 I also get a similar error when I try to use @font-face Fatal error : Class 'Font' not found in / home / scripts / public_html / MarketingPalv2 / include / font_metrics . cls . php on line 346 Hope you guys can help. 回答1: I figured out what it was. I downloaded the newest version of php-font-lib but i needed a older version. 回答2:

Upgrading to angular-6.x gives “Uncaught ReferenceError: global is not defined”

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I upgraded my project from angular-5.x to angular-6.x and it started giving the following error and even creation of dummy global variable does not work as given here Angular 6 Auth0 - global not defined The error is as follows: Uncaught ReferenceError: global is not defined at Object../node_modules/has-binary2/index.js (index.js:10) at __webpack_require__ (bootstrap:81) at Object../node_modules/socket.io-parser/index.js (index.js:8) at __webpack_require__ (bootstrap:81) at Object../node_modules/socket.io-client/lib/index.js (index.js:7) at

Heroku app crashes with &#039;libruby.so.1.9: cannot open shared object file&#039; [closed]

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've never had problems deploying this app but I've just pushed and now I'm getting this weird error, which is deep enough in the stack that it's not even getting sent to Airbrake. I have a feeling it might be a problem at Heroku's end, possibly relating to https://status.heroku.com/incidents/450 ? What do you think? 2012-10-14T08:40:31+00:00 heroku[web.1]: State changed from starting to crashed 2012-10-14T08:40:31+00:00 heroku[web.1]: State changed from crashed to starting 2012-10-14T08:40:35+00:00 heroku[web.1]: Starting process with