Error: polifill promise angularfire2 - angularfire2

I'm stuck with my angular fire-2 offline/ionic3 app. it keeps giving me this error when I try to upload my app to ionic view. it has no errors when I build for Android nor when I use ionic lab.
I saw that other people have a polyfill problem and they suggest doing:
npm install promise-polyfill --save-exact
but it does not work for me, the error is still there. these are my versions (package.json):
"firebase": "^4.3.0",
"angularfire2": "^4.0.0-rc0",
"angularfire2-offline": "^4.2.4",
Error: ./node_modules/firebase/utils/promise.js Module not found: Error: Can't resolve 'promise-polyfill' in
remote: '/usr/src/app/node_modules/firebase/utils' resolve 'promise-polyfill' in
remote: '/usr/src/app/node_modules/firebase/utils' Parsed request is a module using description file:
remote: /usr/src/app/node_modules/firebase/package.json (relative path: ./utils) Field 'browser' doesn't contain a
remote: valid alias configuration after using description file: /usr/src/app/node_modules/firebase/package.json
remote: (relative path: ./utils) resolve as module looking for modules in /usr/src/app/node_modules using
remote: description file: /usr/src/app/package.json (relative path: ./node_modules) Field 'browser' doesn't contain
remote: a valid alias configuration after using description file: /usr/src/app/package.json (relative path:
remote: ./node_modules) using description file: /usr/src/app/package.json (relative path:
remote: ./node_modules/promise-polyfill) no extension Field 'browser' doesn't contain a valid alias configuration
remote: /usr/src/app/node_modules/promise-polyfill doesn't exist .ts Field 'browser' doesn't contain a valid alias
remote: configuration /usr/src/app/node_modules/promise-polyfill.ts doesn't exist .js Field 'browser' doesn't
remote: contain a valid alias configuration /usr/src/app/node_modules/promise-polyfill.js doesn't exist .json Field
remote: 'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/promise-polyfill.json
remote: doesn't exist as directory /usr/src/app/node_modules/promise-polyfill doesn't exist
remote: [/usr/src/app/node_modules/promise-polyfill] [/usr/src/app/node_modules/promise-polyfill.ts]
remote: [/usr/src/app/node_modules/promise-polyfill.js] [/usr/src/app/node_modules/promise-polyfill.json]
remote: [/usr/src/app/node_modules/promise-polyfill] # ./node_modules/firebase/utils/promise.js 14:76-103 #
remote: ./node_modules/firebase/app/firebase_app.js # ./node_modules/firebase/app.js #
remote: ./node_modules/firebase/firebase-browser.js # ./src/providers/camera/camera.ts # ./src/app/app.module.ts #
remote: ./src/app/main.ts

npm install angularfire2 firebase promise-polyfill --save
angularfire2 has updated their docs.
https://github.com/angular/angularfire2/blob/master/docs/Auth-with-Ionic3-Angular4.md

I have the exact same error after installing angularfire2 to my app; only when pushing the code to ionic pro platform.
First I had the error building for ios as well, that got away by updating angularfire2 to another version :
npm i --save angularfire2#4.0.0-rc.1
Maybe you can try that ?

Related

Setting up vue in laravel, npm run watch -> error

I am new to laravel, I am trying to use vue.js in laravel 9 and I followed step by step video guidance for exactly laravel 9 and in the last step you should type npm run watch in terminal and I get
watch
webpack --watch --progress
assets by status 0 bytes [cached] 1 asset
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/
ERROR in main
Module not found: Error: Can't resolve './src' in '/root/PhpstormProjects/eshop'
resolve './src' in '/root/PhpstormProjects/eshop'
using description file: /root/PhpstormProjects/eshop/package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
using description file: /root/PhpstormProjects/eshop/package.json (relative path: ./src)
no extension
Field 'browser' doesn't contain a valid alias configuration
/root/PhpstormProjects/eshop/src doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/root/PhpstormProjects/eshop/src.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/root/PhpstormProjects/eshop/src.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
/root/PhpstormProjects/eshop/src.wasm doesn't exist
as directory
/root/PhpstormProjects/eshop/src doesn't exist
webpack 5.73.0 compiled with 1 error and 1 warning in 134 ms
Anybody knows why?

Module lazy loading of angular 4 not working with Laravel Project

I am trying to use Angular as frontend and Laravel as backend and I have created my Angular project with lazy loaded modules and used webpack to do so.
However, when I use my webpack-dev-server the lazy loading works find and when I use my build files and serve using Laravel it throws the error like this
Uncaught SyntaxError: Unexpected token <
Error: Loading chunk 0 failed.
at HTMLScriptElement.onScriptComplete (polyfills.js:104) [angular]
at HTMLScriptElement.wrapFn (polyfills.js:8558) [angular]
at Object.onInvokeTask (app.js:4091) [angular]
The chunk generation works fine. It generates files like 0.chunk.js and on...
Thanks
The other build files used the path to assets,
So added that same path for chunk file generation in the webpack.config.js. I thought the path property used for all the generated file.
the code goes like this.
output: {
filename: '[name].js',
chunkFilename: '[id].chunk.js',
publicPath: 'assets/',
path: path.resolve(__dirname, 'assets/')
}

Composer fails executing app/console cache:clear on symfony 3

I cant run composer install because it fails when executing the post-install-cmd-scripts.
The reason is Symfony 3 moved the console app from the app folder to a bin folder.
I have tried composer clear-cache and composer self-update, so I can verify that I'm running the latest version of composer without any luck... Can anyone help me?
Results from composer diagnose
composer diagnose
Checking composer.json: FAIL
Defining autoload.psr-4 with an empty namespace prefix is a bad idea for performance
require.symfony/symfony : unbound version constraints (dev-master) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK
Edit:
Added my composer.json file: Pastie
Extra's part:
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
Error from Composer:
Could not open input file: app/console
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
Could not open input file: app/console
.
Manuall test of bin/composer cache:clear:
bin/console cache:clear
// Clearing the cache for the dev environment with debug true
[OK] Cache for the "dev" environment (debug=true) was successfully cleared.
The problem repo: https://bitbucket.org/Richardh87/messenger
Had the same problem. Found that var directory was missing.
Adding var directory to project root dir solved this for me. It looks like symfony 3 tries to use old project structure if var folder is missing. Hope this can help someone.
try
sudo rm -rf vendor/*
sudo rm -rf composer.lock
then run
composer install
again
Check the extra config key in the composer.json files names as symfony-bin-dir.
So check that the composer contain the correct configuration key, as example:
composer.json
....
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
....
Changing the gitignore worked for me, like this:
# Cache and logs (Symfony3)
/var/cache/*
/var/logs/*
!var/cache/.gitkeep
!var/logs/.gitkeep
# Parameters
/app/config/parameters.yml
/app/config/parameters.ini
# Managed by Composer
/app/bootstrap.php.cache
/var/bootstrap.php.cache
/bin/*
!bin/console
!bin/symfony_requirements
/vendor/
# Assets and user uploads
/web/bundles/
/web/uploads/
# Assets managed by Bower
/web/assets/vendor/
# PHPUnit
/app/phpunit.xml
/phpunit.xml
# Build data
/build/
# Composer PHAR
/composer.phar

Downloading: connection...Failed to download cartalyst/nested-sets from dist:

I'm having some problems with a package (cartalyst/nested-sets) on my local laravel application. My composer.json is valid as:
$ composer validate
./composer.json is valid
I have a copy of the nested-sets package files on my desktop and have included them in my project tree - so the files are present and paths are correct.
Here's a snapshot of my composer.json file:
"require": {
"cartalyst/nested-sets": "2.0.*"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.cartalyst.com"
}
],
...
I then issue:
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing cartalyst/nested-sets (v2.0.2)
Downloading: connection...Failed to download cartalyst/nested-sets from dist: The "https://api.github.com/repos/cartalyst/nested-sets/zipball/7a425710ece922556e55150f5a1f2dfbedd4ffaa" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
- Installing cartalyst/nested-sets (v2.0.2)
Cloning 7a425710ece922556e55150f5a1f2dfbedd4ffaa
It then just hangs with a blinking cursor at the shell. PHP OpenSSL extension is installed on my local and switching the firewall off makes no difference.
From the shell:
Failed to download cartalyst/nested-sets from dist: file could not be downloaded (HTTP/1.1 404 Not Found) but the files are already there? I don't understand.
You encounter this problem because you have to subscribe to Cartalyst repositories so you can get full access of their ressources and products ( libraries , components , sources ).
When Composer is trying to fetch Cartalyst from donwload or accessing a repository , it will ask you a valid username / password , if you have paid for a subscription you will get a valid auth credentials that enable you to access the repository and donwload via composer the required component / library ...
please read the following : https://medium.com/#Cartalyst/boss-sheet-8019c5e07246

Cannot find module twilio when using heroku and meteor

I cannot figure out how to get the twilio npm module working on a heroku dyno using meteor js. It works great on localhost, but it crashes on heroku. This is how I built my heroku app:
heroku create meteorherokutwilio --stack cedar --buildpack https://github.com/oortcloud/heroku-buildpack-meteorite.git
heroku config:add ROOT_URL=http://meteorherokutwilio.herokuapp.com/
heroku labs:enable websockets -a meteorherokutwilio
git push heroku master
I've added twilio to my meteor project like this:
mrt add twilio
This is how I'm loading twilio:
var client = Npm.require('twilio')("key", "secret");
This is the error:
/app/.meteor/heroku_build/app/programs/server/boot.js:186
}).run();
^
Error: Cannot find module 'twilio'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.Npm.require (/app/.meteor/heroku_build/app/programs/server/boot.js:88:18)
at app/meteor-heroku-twilio.js:18:24
at /app/.meteor/heroku_build/app/programs/server/boot.js:159:61
at Array.forEach (native)
at Function._.each._.forEach (/app/.meteor/heroku_build/app/programs/server/node_modules/underscore/underscore.js:79:11)
at /app/.meteor/heroku_build/app/programs/server/boot.js:159:5
Process exited with status 8
State changed from starting to crashed
I've also made a git repo with the minimum amount of code to demonstrate the problem: https://github.com/esromneb/meteor-heroku-twilio/
Npm.require works only for standard node packages (well, it works for packages it found installed, but you should only rely on it for standard packages, unless you want to manually add packages to your Heroku server and each server you'd like to run in the future).
For all other npm packages, there's npm meteorite package.
Add it to your project with mrt add npm command.
Then create packages.json file with a list of all required packages, for example:
{
"twilio": "1.5.0",
"oauth": "0.9.11"
}
Afterwards, include your package with Meteor.require:
var client = Meteor.require('twilio')("key", "secret");

Resources