-
-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel 7 - ModuleNotFoundException #995
Comments
Hi, did you add the autoloading of modules in the composer.json of your project (you can find out how in the readme)? |
Hey, yes, that's there. It was fine with Laravel 6. Here's the appropriate section: https://github.com/nabeelio/phpvms/blob/dev/composer.json#L85 |
I updated the main post with some more information |
Hm that's weird. |
I get the same problem. The error is happening during the module generation. It's not outputting the full stacktrace, I'm trying to see what it's attempting to do |
Here's the full stacktrace. Looks like it's failing to create the provider, though the
|
The generated controller name isn't also being substituted anymore: /**
* Class $CLASS$
* @package
*/
class $CLASS$ extends Controller
{ Whereas before it took the name of the created module. |
Ok, so I removed all of the files to generate from the config, it was just confusing me. So it should generate automatically only the
But I'm not sure why it's not finding it even after the |
I'm not sure what's going on here. Did you customise the installation? |
The only thing I customized was the templates. I will try to get a L7 install together with a default but yeah I'm not sure why this is happening either. It just looks like after it generates the module.json and composer.json files, it doesn't refresh its own cache of which modules are installed. I think there might be a conflict somewhere with the caching and that configuration |
I met the same problem like yours |
have you resolved this problem? |
I haven't, still waiting for a fix. I haven't had the chance to dupe it on a fresh install. Have you? |
Not yet,I'm waiting too |
As I haven't been able to reproduce this at all, maybe you guys could look for the problem & a possible fix? 😅 |
I‘d like to,but limited to my level... |
@williamqian have you modified any templates? @nWidart I have a suspicion it's with the caching and scanning after a module is generated but I'm not familiar enough with it |
Yes, I just copy all the .stubs to another path,and set enabled to true,my laravel framework's version is 7.21.0。
|
@williamqian thanks... How about in a fresh project? @nWidart that seems to be a commonality, have you tried testing with that? I will try to dupe in a fresh project over the weekend |
in fresh project,it works well until I set cache.enabled=true in config/modules.php,so I set my project's cache.enabled=false,now it works well... |
Interesting, I'll have to try that. That seems like a bug for sure, I leave the cache disabled because a user can add modules at any time. @nWidart does that help? |
Disable/lower the cache time as found as a workaround in nWidart/laravel-modules#995
Disable/lower the cache time as found as a workaround in nWidart/laravel-modules#995
* Update module generation #714 * Fix method signatures * Fix paths within stubs, use single provider.stub file * Add separate index controller * Update module generation #714 * Fix method signatures * Fix paths within stubs, use single provider.stub file * Update module generation Disable/lower the cache time as found as a workaround in nWidart/laravel-modules#995 * Update editorconfig for line endings * Formatting * Formatting
Hi, why'd this get closed? We outlined the bug above... if cache is enabled then there's a problem |
Hi, With laravel 8 I cleaned up the issues on the repository. |
Ok, great, thanks, just didn't see a commit linked to this or mentioned in the change log. Is it fixed only for Laravel 8 going forward, or the next release of this? Is there a migration guide on if anything has changed? I'm trying to understand the impact of something like #996 |
Hi, You could try on laravel 8 to see if you still have the issue, hopefully not. Regarding #996, there is no action required. That PR was also merged & tagged before this release, so you likely already have it. |
I haven't migrated to 8 yet, that might be a larger task... for L7, I'm guessing the 8x version of this will be fine |
Ah yes I understand. Please let me know if the issue persists in the future! |
I was facing same issue because of renaming module folder without updating So make sure that |
Hi,
Testing after updating to Laravel 7, running into a few issues, mainly this one has me stumped:
It looks like all the files I'm expecting are generated:
This is what my config looks like; I'm generating some extra files and scaffolding:
I'm trying to debug with some people who are running into issues with generating modules; it looks like the service provider (
TestModuleServiceProvider
in this case wasn't generated). And it looks also like the caches (config, routes) didn't get cleared (I can't remember if this was supposed to be the case). It could also be that I'm missing some configuration or something in the upgrade to Laravel 7, but I haven't seen anything specific). Thanks!The text was updated successfully, but these errors were encountered: