dedoc/scramble

Route [scramble.docs.index] not defined.

Closed this issue · 6 comments

Fresh install of scramble added to my composer install.

If i checkout tag v0.9.0 everything just works, however v0.10.0 and on-wards generates

Route [scramble.docs.index] not defined.

When trying to view the generated docs.

I'll try and investigate a bit further later, but couldn't see anything obvious from my untrained eyes at first glance.

Okay this is very strange I can "fix" this my hardcoding the url in the <elements-api like this

<elements-api
    id="docs"
    apiDescriptionUrl="https://myapi/docs/api.json"
    tryItCredentialsPolicy="{{ $config->get('ui.try_it_credentials_policy', 'include') }}"
    router="hash"
    @if($config->get('ui.hide_try_it')) hideTryIt="true" @endif
    logo="{{ $config->get('ui.logo') }}"
/>
<script>
    (async () => {
        const docs = document.getElementById('docs');
        //docs.apiDescriptionDocument = @json($spec);
    })();
</script>
</body>
</html>

So I'm not really sure what's going on. Our API is actually split between an admin api and a public api. When I split this out using the multiple ui routes example everything is fine and I din't need to hardcode the apiDescriptionUrl everything just works.

Before when both the public api/admin api was being generated together it crashes, but only prior to v0.9.0

@Alan01252 I would try running php artisan route:list and check the route name. Maybe the name has changed between versions and you published the view?

@Alan01252 I would try running php artisan route:list and check the route name. Maybe the name has changed between versions and you published the view?

Not sure this is the case, git status is clean and I blew away the vendor directory several times to make sure it was okay.

I have feeling this is something to do with the size of generated openai config, because the json renders fine but the UI didn't.

When splitting it to admin/public ( which is what I want to do anyway ) it works perfectly ( and is awesome )...

If you provide a reproduction, I would be happy to help.

If you found a solution, feel free to close the issue.

Thanks @romalytvynenko

For the life of me now I can't reproduce, so I am going with this being Alan error somewhere as you suggested ;)

Thanks for your help and apologies for the time waste.