Closed Shigetorum635 closed 2 years ago
Dearly and beloved member Julien did advise me!
For information, the problem is located here: https://github.com/eidellev/inertiajs-adonisjs/blob/90cb2d1c85088fc18fb5c28579edb15b9fe76aee/providers/InertiaProvider/InertiaProvider.ts#L174
If the user has not installed @adonisjs/view
, the callback of withBindings will never be executed since Adonis/Core/View
is not found, and therefore the provider of Inertia will never get registered, that's what causes the error
So you just have to run :
npm install @adonisjs/view
node ace configure @adonisjs/view
And you should be good 👍
Maybe @eidellev you could add a peerDependencies to @adonisjs/view or maybe a "Prerequisites" section in the readme ?
For information, the problem is located here:
If the user has not installed
@adonisjs/view
, the callback of withBindings will never be executed sinceAdonis/Core/View
is not found, and therefore the provider of Inertia will never get registered, that's what causes the errorSo you just have to run :
npm install @adonisjs/view node ace configure @adonisjs/view
And you should be good 👍
Maybe @eidellev you could add a peerDependencies to @adonisjs/view or maybe a "Prerequisites" section in the readme ?
Made a PR! https://github.com/eidellev/inertiajs-adonisjs/pull/49#issue-1096472131
Here's where its highlited as the error origin. The rest is just some more info.
Context:
I was making a REST API application, but figured that in my case it could be better to use InertiaJS, so I installed adonisjs session module aswell as InertiaJS, following the tutorials, and adding the middleware.
My use case is really simple;
For some reason VSCode can find the module, but Adonis is not capable.
Controller
start/inertia.ts
![image](https://user-images.githubusercontent.com/48862659/148572520-51dba9cf-f46d-4a0e-93da-361a96dbdda2.png)
I asked this on the Discord and they told me to check my providers in adonisrc.json file, it's there.