Unable to resolve some modules:Meteor 1.3 with ECMAScript - meteor

I am adding video upload to youtube so I am using npm module Youtube-video-api.And then adding ECMAScript import youtube-video-api on client side.
So added Meteor package: meteor add ecmascript
I get the error:
Unable to resolve some modules:
"eventEmitter" in /home/ananth/GREENROOM/greenroom/app/client/lib/plugins/core.min.js (web.browser)
"eventie" in /home/ananth/GREENROOM/greenroom/app/client/lib/plugins/core.min.js (web.browser)
"fs" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/node_modules/request/lib/har.js (web.browser)
"path" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare/lib/nightmare.js (web.browser)
"url" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/index.js (web.browser)
"util" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/node_modules/request/request.js (web.browser)
"querystring" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/node_modules/request/lib/har.js (web.browser)
"net" in /home/ananth/GREENROOM/greenroom/app/node_modules/forever-agent/index.js (web.browser)
"punycode" in /home/ananth/GREENROOM/greenroom/app/node_modules/tough-cookie/lib/cookie.js (web.browser)
"crypto" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/node_modules/request/lib/oauth.js (web.browser)
"http" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/node_modules/request/request.js (web.browser)
"https" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/node_modules/request/request.js (web.browser)
"stream" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/node_modules/request/request.js (web.browser)
"zlib" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare-google-oauth2/node_modules/request/request.js (web.browser)
"buffer" in /home/ananth/GREENROOM/greenroom/app/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js (web.browser)
"events" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare/lib/ipc.js (web.browser)
"dgram" in /home/ananth/GREENROOM/greenroom/app/node_modules/request/node_modules/sntp/lib/index.js (web.browser)
"dns" in /home/ananth/GREENROOM/greenroom/app/node_modules/request/node_modules/sntp/lib/index.js (web.browser)
"assert" in /home/ananth/GREENROOM/greenroom/app/node_modules/verror/lib/verror.js (web.browser)
"tls" in /home/ananth/GREENROOM/greenroom/app/node_modules/forever-agent/index.js (web.browser)
"child_process" in /home/ananth/GREENROOM/greenroom/app/node_modules/nightmare/lib/nightmare.js (web.browser)
Consider running: meteor npm install --save eventEmitter eventie meteor-node-stubs
How can I resolve this?

Related

Connection failed: Buffer is not defined - Error when subscribing to AWS Amplify (graphql) Subscriptions after update to v4.7.0

I have just updated from Amplify-cli 4.0.0 to 4.7.0 and now I am getting these errors when attempting to listen for my subscriptions.
{provider: AWSAppSyncRealTimeProvider, error: {…}}
provider: AWSAppSyncRealTimeProvider {_config: {…}, socketStatus: 0, keepAliveTimeout: 300000, subscriptionObserverMap: Map(0), promiseArray: Array(0), …}
error:
errors: Array(1)
0:
message: "Connection failed: Buffer is not defined"
__proto__: Object
length: 1
__proto__: Array(0)
__proto__: Object
__proto__: Object
I am using Ionic 4, and just before the update everything was working just fine.
Please refer to the below link: Looks like you need to polyfill buffer.
https://github.com/agoncal/swagger-ui-angular6/issues/2

Symfony + API Platform: Error 500 on all post requests (appeared suddenly)

I'm currently working on an API using Symfony and API_Platform.
Everything is going great (POST requests are working), but suddendly i can't make any POST request (even using EasyAdmin bundle).
Im getting this logs :
2019-05-23T13:51:05+00:00 [critical] Class 'GuzzleHttp\Client' not found
[Thu May 23 15:51:05 2019] 127.0.0.1:54351 [500]: /api/authors - Class 'Symfony\Component\BrowserKit\Client' not found in D:\projects\hp-api-2\vendor\symfony\http-kernel\Client.php on line 31
2019-05-23T13:51:05+00:00 [critical] Fatal Error: Class 'Symfony\Component\BrowserKit\Client' not found
I tried to require both bundles but it did not fix my errors.
I created another API Project, worked on it for 2 days, and the same error appeared again for no reason.
I'm totally lost about this one.
I'm using Wamp for PHP/MySQL. But i dont think it's the problem since it was working fine before.
Here are my dependencies:
"require": {
"php": "~7.2.3",
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/api-pack": "^1.2",
"doctrine/doctrine-migrations-bundle": "^2.0",
"easycorp/easyadmin-bundle": "^2.1",
"symfony/apache-pack": "^1.0",
"symfony/console": "4.2.*",
"symfony/dotenv": "4.2.*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "4.2.*",
"symfony/maker-bundle": "^1.11",
"symfony/yaml": "4.2.*"
},
"require-dev": {
"symfony/profiler-pack": "^1.0",
"symfony/web-server-bundle": "4.2.*"
}
When I require symfony/browser-kit --dev, I get this:
2019-05-23T13:57:34+00:00 [critical] Class 'GuzzleHttp\Client' not found
2019-05-23T13:57:35+00:00 [critical] Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundException: "Attempted to load class "Client" from namespace "GuzzleHttp".
Did you forget a "use" statement for e.g. "Symfony\Component\HttpKernel\Client", "Symfony\Component\BrowserKit\Client" or "Symfony\Bundle\FrameworkBundle\Client"?" at D:\projects\hp-api-2\var\cache\dev\ContainerDsBBqcY\getApiPlatform_Doctrine_Listener_HttpCache_PurgeService.php line 13
And if I require guzzlehttp/guzzle --dev I get this :
2019-05-23T14:01:32+00:00 [critical] Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\EnvNotFoundException: "Environment variable not found: "VARNISH_URL"." at D:\projects\hp-api-2\vendor\symfony\dependency-injection\EnvVarProcessor.php line 96
I didnt configure cache system at all, it's the default settings.
If you need any more informations, feel free to ask.
Please excuse me for English mistakes, if I did any.
Thank you.
Antoine
EDIT: I tried to not use wamp for my php/mysql and now when I make a post request i have some error message from Symfony (i didnt have one before):
Symfony\Component\Debug\Exception\FatalErrorException:
Error: Uncaught Error: Class 'Symfony\Component\BrowserKit\Client' not found in D:\projects\hp-api-2\vendor\symfony\http-kernel\Client.php:31
Stack trace:
#0 D:\projects\hp-api-2\vendor\symfony\debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler.php(174): require_once()
#1 D:\projects\hp-api-2\vendor\symfony\debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler.php(136): Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->convertFileToClass('D:\\projects\\hp-...', 'D:\\projects\\hp-...', 'Symfony\\Compone...')
#2 D:\projects\hp-api-2\vendor\symfony\debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler.php(118): Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->findClassInPath('D:\\projects\\hp-...', 'Client', 'Symfony\\Compone...')
#3 D:\projects\hp-api-2\vendor\symfony\debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler.php(62): Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->getClassCandidates('Client')
#4 D:\projects\hp-api-2\vendor\s
at vendor/symfony/http-kernel/Client.php:31
EDIT 2: I "fixed" my problem by requiring both bundles + disabling varnish urls
api_platform:
version: 0.0.1
mapping:
# paths: ['%kernel.project_dir%/src/Entity']
paths: ['%kernel.project_dir%/config/api_platform/resources']
http_cache:
invalidation:
enabled: true
# varnish_urls: ['%env(VARNISH_URL)%'] ## this problem still needs to be fixed
max_age: 0
shared_max_age: 3600
vary: ['Content-Type', 'Authorization']
public: true
I've just fixed by adding guzzle dependency:
composer req guzzlehttp/guzzle

Error starting react project

I'm following this tutorial on building a React app on top of WordPress, and I'm having trouble starting it.
I modified package.json file a bit and webpack.config.js` and I am getting the following error in my terminal
➜ wp-api git:(development) ✗ npm start
> wp-api#1.0.0 start /Users/myuser/Projects/wp-api
> webpack-dev-server --open
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.resolve has an unknown property 'modulesDirectories'. These properties are valid:
object { alias?, aliasFields?, cachePredicate?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
- configuration.resolve.extensions[0] should not be empty.
npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/Cellar/node/7.10.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! wp-api#1.0.0 start: `webpack-dev-server --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wp-api#1.0.0 start script 'webpack-dev-server --open'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the wp-api package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --open
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs wp-api
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls wp-api
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/myuser/.npm/_logs/2017-05-15T07_40_36_249Z-debug.log
The log file is
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/7.10.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'start' ]
2 info using npm#4.2.0
3 info using node#v7.10.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle wp-api#1.0.0~prestart: wp-api#1.0.0
6 silly lifecycle wp-api#1.0.0~prestart: no script for prestart, continuing
7 info lifecycle wp-api#1.0.0~start: wp-api#1.0.0
8 verbose lifecycle wp-api#1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle wp-api#1.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/myuser/Projects/wp-api/node_modules/.bin:/Users/myuser/.rbenv/shims:/Users/myuser/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
10 verbose lifecycle wp-api#1.0.0~start: CWD: /Users/myuser/Projects/wp-api
11 silly lifecycle wp-api#1.0.0~start: Args: [ '-c', 'webpack-dev-server --open' ]
12 silly lifecycle wp-api#1.0.0~start: Returned: code: 1 signal: null
13 info lifecycle wp-api#1.0.0~start: Failed to exec start script
14 verbose stack Error: wp-api#1.0.0 start: `webpack-dev-server --open`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:194:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:194:7)
14 verbose stack at maybeClose (internal/child_process.js:899:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid wp-api#1.0.0
16 verbose cwd /Users/myuser/Projects/wp-api
17 error Darwin 16.5.0
18 error argv "/usr/local/Cellar/node/7.10.0/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.10.0
20 error npm v4.2.0
21 error code ELIFECYCLE
22 error errno 1
23 error wp-api#1.0.0 start: `webpack-dev-server --open`
23 error Exit status 1
24 error Failed at the wp-api#1.0.0 start script 'webpack-dev-server --open'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the wp-api package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error webpack-dev-server --open
24 error You can get information on how to open an issue for this project with:
24 error npm bugs wp-api
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls wp-api
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]
The package.json and webpack.config.js are:
{
"name": "wp-api",
"version": "1.0.0",
"description": "React based WordPress app",
"main": "index.js",
"dependencies": {
"alt": "^0.18.6",
"axios": "^0.15.3",
"extract-text-webpack-plugin": "^2.1.0",
"lodash": "^4.17.4",
"node-sass": "^4.5.2",
"prop-types": "^15.5.8",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-router": "^3.0.1",
"sass-loader": "^6.0.3"
},
"devDependencies": {
"babel-core": "^6.21.0",
"babel-loader": "^6.2.10",
"babel-preset-env": "^1.4.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.0",
"firebase-tools": "^3.6.1",
"html-webpack-plugin": "^2.28.0",
"react-hot-loader": "^1.3.1",
"style-loader": "^0.16.1",
"webpack": "^2.4.1",
"webpack-dev-server": "^2.4.2"
},
"scripts": {
"start": "webpack-dev-server --open",
"test": "echo \"Error: no test specified\" && exit 1"
},
"babel": {
"presets": [
"env",
"react"
]
},
"author": "dingo-d",
"license": "GPL"
}
and
var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const outputCss = 'styles/[name].css';
var config = {
devtool: 'inline-source-map', // This will show line numbers where errors are accured in the terminal
devServer: {
historyApiFallback: true, // This will make the server understand "/some-link" routs instead of "/#/some-link"
},
entry: [
'webpack-dev-server/client?http://127.0.0.1:8080/', // Specify the local server port
'webpack/hot/only-dev-server', // Enable hot reloading
'./src/index' // This is where Webpack will be looking for the entry index.js file
],
output: {
path: path.join(__dirname, 'public'), // This is used to specify folder for producion bundle. Will not be used here, but it's a good practice to have it
filename: 'bundle.js' // Filename for production bundle
// publicPath: '/'
},
resolve: {
modulesDirectories: ['node_modules', 'src'], // Folders where Webpack is going to look for files to bundle together
extensions: ['', '.js'] // Extensions that Webpack is going to expect
},
module: {
// Loaders allow you to preprocess files as you require() or “load” them. Loaders are kind of like “tasks” in other build tools, and provide a powerful way to handle frontend build steps.
loaders: [
{
test: /\.jsx?$/, // Here we're going to use JS for react components but including JSX in case this extension is prefered
exclude: /node_modules/, // Speaks for itself
loaders: ['react-hot', 'babel?presets[]=react,presets[]=es2015'] // Modules that help with hot reloading and ES6 transcription
}
],
rules: [
{ test: /\.(js)$/, use: 'babel-loader' },
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader'
},
{
loader: 'sass-loader'
}
]
})
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(), // Hot reloading
new webpack.NoErrorsPlugin(), // Webpack will let you know if there are any errors
new HtmlWebpackPlugin({
template: 'index.html'
}),
]
}
module.exports = config;
I haven't done much projects with webpack, so my knowledge in this aspect is very limited.
What am I doing wrong? I tried deleting the node_modules folder and running npm install again, but that didn't work.
Solution to the 1st problem:
npm uninstall webpack --save-dev
npm install webpack#2.1.0-beta.22 --save-dev
Solution to the
configuration.resolve.extensions[0] should not be empty. :
Remove '' from the array
resolve: {
modulesDirectories: ['node_modules', 'src'], // Folders where Webpack is going to look for files to bundle together
extensions: ['.js'] // Extensions that Webpack is going to expect
},
Or replace it with '*'
resolve: {
modulesDirectories: ['node_modules', 'src'], // Folders where Webpack is going to look for files to bundle together
extensions: ['*','.js'] // Extensions that Webpack is going to expect
},

Module not found: Error: Cannot resolve 'file' or 'directory' (import sass in webpack)

My project structure is:
/src/styles/main.scss
#import 'materialize/sass/materialize.scss';
....
I also try #import './materialize/sass/materialize.scss'; here
notwork.
It only work when I import the lib in index.js
/src/index.js (this worked)
import './styles/reset.css';
import './styles/main.scss';
import './styles/font-awesome/font-awesome.scss';
webpack loader:
loaders: [
{
test: /\.js?/,
exclude: [/node_modules/, /styles/],
loaders: ['babel'],
include: path.join(__dirname, 'src')
},
{
test: /\.scss$/,
loader: 'style!css!sass'
},
{
test: /\.css$/,
loader: "style-loader!css-loader"
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader'
}
]
But got error:
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Thin.eot in E:\Project\simple-redux
-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:73945-73987 6:74010-74052
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Thin.woff2 in E:\Project\simple-red
ux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:74104-74148
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Thin.woff in E:\Project\simple-redu
x-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:74181-74224
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Thin.ttf in E:\Project\simple-redux
-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:74256-74298
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Light.eot in E:\Project\simple-redu
x-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:74430-74473 6:74496-74539
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Light.woff2 in E:\Project\simple-re
dux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:74591-74636
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Light.woff in E:\Project\simple-red
ux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:74669-74713
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Light.ttf in E:\Project\simple-redu
x-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:74745-74788
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Regular.eot in E:\Project\simple-re
dux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:74922-74967 6:74990-75035
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Regular.woff2 in E:\Project\simple-
redux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:75087-75134
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Regular.woff in E:\Project\simple-r
edux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:75167-75213
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Regular.ttf in E:\Project\simple-re
dux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:75245-75290
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Medium.eot in E:\Project\simple-red
ux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:75401-75445 6:75468-75512
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Medium.woff2 in E:\Project\simple-r
edux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:75564-75610
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Medium.woff in E:\Project\simple-re
dux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:75643-75688
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Medium.ttf in E:\Project\simple-red
ux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:75720-75764
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Bold.eot in E:\Project\simple-redux
-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:75875-75917 6:75940-75982
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Bold.woff2 in E:\Project\simple-red
ux-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:76034-76078
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Bold.woff in E:\Project\simple-redu
x-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:76111-76154
ERROR in ./~/css-loader!./~/sass-loader!./src/styles/main.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Bold.ttf in E:\Project\simple-redux
-boilerplate\src\styles
# ./~/css-loader!./~/sass-loader!./src/styles/main.scss 6:76186-76228
It looks like webpack search for a wrong directory, not search fonts folder under materialize.
I got error every time when I put import sass lib in main.scss, which force me to put import to index.js. Anyway to workaround ?
Update:
I found there are config in
\src\styles\materialize\sass\components\_variables.scss:
$roboto-font-path: "../fonts/roboto/" !default;
But it is relate to components, is this webpack 's bug?
I think it is a problem related to css-loader or sass-loader, somehow they are not really resolving the paths correctly when inside node_modules. And that is the reason why you have those errors.
Look at the error:
Error: Cannot resolve 'file' or 'directory' ../fonts/roboto/Roboto-Bold.woff in E:\Project\simple-redux-boilerplate\src\styles
It seems that the css-loader is trying to find ../fonts/ inside your src/styles folder.
As a workaround, you can specify the "correct" place where the fonts are placed as your $roboto-font-path variable. If installed via npm install materialize-css you can do the following:
$roboto-font-path: '~materialize-css/fonts/roboto/';
The tilde (~) character will say to your loaders to look into node_modules. Then, when resolving your paths, your loaders will look to the correct place and there will be no errors.
I think (and tested it locally) you don't need to use the tilde character to look at node_modulesusing sass-loader.
If you don't want to look into node_modules (because you prefer to download the dependencies manually) you can just use the relative paths. In your case $roboto-font-path: './materialize/fonts/roboto/'; should fix it.
Update:
You can also try using resolve-url-loader, that tries to fix the urls for you.
Related:
How do I load font-awesome using SCSS (SASS) in Webpack using relative paths?

Composer behind proxy not working for symfony project

In my workplace network we have to use a proxy. I want to use Composer a to download some package dependencies for my Symfony2 projects. It does not work even after declaring the environment variable with the proxy information. I noticed that we are also unable to revolve any external name using the DNS of the company. And I think that one is the main problem that does not alow us to download with composer.
The truth is that I can not change any thing on those servers or policies of the company.
Do you think that I can do something that can let me resolve those names or access those resources to install the dependencies?
this is the error:
The "http://thirds.packagist.dev/packages.json" file could not be downloaded (HTTP/1.0 503 Service Unavailable)
http://thirds.packagist.dev could not be fully loaded, package information was loaded from the local cache and may be out of date
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. O
penSSL Error messages:
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
failed to open stream: Cannot connect to HTTPS server through proxy
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
Then the composer.json file is this one:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"repositories": [
{
"type": "composer",
"url": "http://thirds.packagist.dev"
}
],
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
"sensio/generator-bundle": "~2.3",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "1.3.4",
"sylius/resource-bundle": "*",
"friendsofsymfony/jsrouting-bundle": "*",
"genemu/form-bundle": "2.2.*"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.4-dev"
}
}
}
Adding composer diag:
root#zeus:/home/abel/Documents/http/team# php composer.phar diag
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
failed to open stream: Cannot connect to HTTPS server through proxy
Checking HTTP proxy: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
failed to open stream: Cannot connect to HTTPS server through proxy
Checking HTTP proxy support for request_fulluri: OK
Checking HTTPS proxy support for request_fulluri: FAIL
Unable to assert the situation, maybe github is down (The "https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0" file could not be downloaded: Peer certificate CN=`*.github.com' did not match expected CN=`201.220.215.11'
failed to open stream: Cannot connect to HTTPS server through proxy)
Checking composer.json: OK
Checking disk free space: OK
Checking composer version:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" file could not be downloaded: SSL operation failed with code 1. OpenS
SL Error messages:
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
failed to open stream: Cannot connect to HTTPS server through proxy
diagnose
root#zeus:/home/abel/Documents/http/team#
Also I tried to declared the ip of packagist.org on my etc hosts... and then i notices that the DNS that is used is not the one of my localhost:
root#zeus:/home/abel/Documents/http/team# php composer.phar update
Loading composer repositories with package information
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection t
imed out
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
root#zeus:/home/abel/Documents/http/team# cat /etc/hosts
127.0.0.1 localhost
201.220.207.218 zeus.ltu.sld.cu zeus
127.0.0.1 thirds.packagist.dev
127.0.0.1 abel.ltu.sld.cu
87.98.253.214 packagist.org
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
root#zeus:/home/abel/Documents/http/team#
I once faced the same issue, and setting the proxy in my terminal solved the problem.
If you're using Windows, enter these commands :
set HTTP_PROXY=http://user:password#proxy.domain.com:port
set HTTPS_PROXY=http://user:password#proxy.domain.com:port
In Unix system, the command is export instead of set.
Then you can run composer update command.
If you still have problems, it might be git that needs the proxy configuration too.
In your %HOMEPATH%\.gitconfig, add the following :
[http]
proxy = http://user:password#proxy.domain.com:port
EDIT:
Since you've added the results of composer diag, the problem seems to be that your proxy doesn't handle the request_fulluri flag for HTTPS requests.
You can disable this option by setting the environment variable HTTPS_PROXY_REQUEST_FULLURI like this (Unix system) :
set HTTPS_PROXY_REQUEST_FULLURI=0

Resources