Lumen deployment error on Heroku / Scalingo - laravel

I created a fresh lumen project using composer and try to put it on heroku/scalingo.
However in both hosting solutions I get the following error:
Generating optimized autoload files
[RuntimeException]
Could not scan for classes inside "/build/4a8cf965dc0068e76480b81aa5321cff/vendor/laravel/lumen-framework/src/Foundation" which does not appear to be a file nor a folder
It is related to composer but I dont understand how.
Thank you

I added to exclude the /vendor/ folder on .gitignore and this solved the problem. But I dont understand what it was looking for that broke it.

Related

Why debug works when I delete .git directory? [Build error AWS Toolkit + AWS SAM]

I'm facing an unusual issue. I am able to debug lambdas with AWS toolkit + Goland using SAM, this is working perfectly. But in a specific case I'm having an error in the BUILD related to VCS. After several tests I concluded that the problem was the .git directory, because when I deleted it the build worked and the debug too. I tried to invalidate caches through Goland but it didn't work. What would be the relationship of this .git directory with this error in the build?
I tried several plugin settings, as they didn't work I tried a very simple test that worked, so I figured the problem must be in some file in the project directory and by elimination I got to the .git directory.
Edit An additional explanation: The problem is the .git directory. It doesn't matter if it has the files generated by git or if it is empty, it is enough for the directory to exist for the problem to occur.

Beego: Routing issues with modules

Routing doesn't work at all for me in bee if I use modules while GOPATH old approach works perfectly.
I am new in golang, correct me if I did something wrong.
I have been trying to create API project with bee, but I found that all new projects have to use the modules approach released in go 1.11.
I used bee api api-name command to scaffold the new project. It appeared in GOPATH. I moved out it from GOPATH path to another directory. Then I did go mod init mod, then I was able to run bee run and API was successfully started but routing didn't work. I did some comparing and found out that commentsRouter file wasn't generated.
What am I do wrong?
I tried to do set GO111MODULE=on and then go get -u github.com/beego/bee but this wasn't helped as well.
Now I can't even run bee API, I see
0004 Failed to build the application: main.go:4:2: package api-name/routers is not in GOROOT (c:\go\src\api-name\routers)
What's happens? I am confused. Official go documentation says that I should prefer modules approach with new projects but I can't find somewhere in docs anything about how to scaffold and use bee with modules system.
Just because missing file commentsRouter_controllers.go. Don't know how beego does not generate file routers/commentsRouter_controllers.go when running app outside $gopath.
Then we can only access to localhost/swagger. Any another path (or route) is all 404 returned.
Solution:
Not a good way but worked:
copy source code of $your_project to $gopath/src
cd $gopath/src/$your_project > bee run (just for generating file commentsRouter_controllers.go) > stop running app
copy file $gopath/src/$your_project/routers/commentsRouter_controllers.go to $your_project/routers
cd $your_project > bee run
Good luck
It looks like latest Beego Bee supports generating routes outside the GOPATH.
Have a check. It did work for me now.

PhpStorm: Can't analyse webpack.config.js: coding assistance will ignore module resolution rules in this file

The error started appearing at the start up of PhpStorm after I have upgraded to 2017.3.3
Webpack.config.js is a default one from Laravel 5.5 build.
Tried to suppress it with no success. Very annoying. Any ideas?
If you want to get rid of this problem you can remove the notifications & log for the Webpack from Settings->Apperance&Behavior->Notifications->Webpack
Common Cause:
There's an error in the Javascript used in your Webpack config when evaluated by IntelliJ.
But it works on the commandline?
It may work fine from the command line but the context that IntelliJ evaluates the config is different than the command line.
How can I tell what the Javascript error is?
Below the Can't analyse webpack.config.js error message, look for Error details:. If it's a Javascript error, this will give you a hint of what's failing.
Example:
I saw the following error when I opened a project in IntelliJ
Can't analyse webpack.config.js: coding assistance will ignore module resolution rules in this file.
Possible reasons: this file is not a valid webpack configuration file or its format is not currently supported by the IDE.
Error details: Cannot read property 'require' of undefined
In this case, there was a plugin configuration in the webpack.config.js using require.main.require. This is fine when ran from the command line but fails in IntelliJ because of the way IntelliJ evaluates the webpack.config.js. When IntelliJ evaluates it, require.main is undefined.
Just an workaround. This will make some changes to your project, but you can revert everything back to its original state after if PhpStorm works fine.
STEP 1
Make sure your git status is clean.
Close your PhpStorm.
Remove package-lock.json and node_modules.
Then regenerate package-lock.json with npm install.
Start PhpStorm and open your project.
Confirm that now it works. Event log like
Module resolution rules from webpack.config.js are now used for coding assistance.
STEP 2
Discard all changes with git checkout ..
Revert under node_modules with npm ci.
Now your project is before the workaround but with coding assistance.

fedex integration with laravel

I am integrating following git-hub library but getting following problem.
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Arkitecht\FedEx\Laravel\Providers\FedExServiceProvider' not found
I am doing same as mentioned in Readme file of project. GitHub project link is as follows:
ArchitechtArchitect Readme
Thanks in Advance
Put:
Arkitecht\FedEx\Laravel\Providers\FedExServiceProvider::class,
in providers within config/app.php
Don't write "Arkitecht\FedEx\Laravel\": "src/" in your composer file.
also, you may need to run composer dump-autoload in the root folder

multiple projects with same vendor folder on Laravel 4

I have multiple projects with very little space to keep.
since most of them uses nearly same packages (only 1 uses phpexcel and the other one swiftmailer ) and vendor folder required biggest space on laravel.
I thought maybe I could use same vendor folder for every of them.
I actually messed with autoload.php and some other config files however I couldn't make it.
simply I'll put vendor folder under public_html and create folder like project1 project2.
under those folders I'll put everything about my projects except vendor folder and then make them subdomain.
Short answer:
You can't.
Long answer:
/vendor folder is not just about packages, you also have in there vendor/composer folder, where your application classes names are stored for autoloading purposes. Everytime you run composer dump-autoload, Composer changes the content of some files there. Take a look at the vendor/composer/autoload_classmap.php file, you'll see that some of those classes are from your own project.
Workaroud:
Please note that I don't see a thing like this going well, but you can, actually, create a blank project, just for package downloading and symlink all packages from all your vendors folders to that one. It's a lot of trouble for a little gain. But it's up to you, of course.
Source: http://www.wenda.io/questions/2416709/laravel-4-1-vendor-directory-config.html
edit composer.json
"config": {
"preferred-install": "dist",
"vendor-dir": "../vendor"
},
edit bootstrap/autoload.php file
require __DIR__.'/../../vendor/autoload.php'
edit bootstrap/start.php file
$framework = $app['path.base'].
'/../vendor/laravel/framework/src';
edit ../vendor/laravel/framework/src/Illuminate/Foundation/Console/Optimize/config.php
$basePath = $app['path.base'].'/../';
then run composer install, you will find vendor dir created ../
php artisan optimize -v --force
Generating optimized class loader
Compiling common classes

Resources