Skip to content
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

Unable to locate publishable resources. #5

Open
climascomunicacion opened this issue Mar 18, 2021 · 32 comments
Open

Unable to locate publishable resources. #5

climascomunicacion opened this issue Mar 18, 2021 · 32 comments

Comments

@climascomunicacion
Copy link

when i ran,
php artisan vendor:publish --provider="BringYourOwnIdeas\LaravelSitemap\SitemapServiceProvider"

there is error message like this :
Unable to locate publishable resources.
Publishing complete.

Using Laravel 8

@spekulatius
Copy link
Member

Hey @climascomunicacion

interesting, I'll check it out and get back to you.

Cheers!

@climascomunicacion
Copy link
Author

My composer.json:

Captura de pantalla 2021-03-18 a las 18 31 11

If i execute php artisan vendor:publish i can't see the Provider:

Captura de pantalla 2021-03-18 a las 18 34 39

@spekulatius
Copy link
Member

Yeah, the provider is missing - I've noticed that too. But interestingly enough it works. I actually never published the provider. What do you want to do with the Provider?

@climascomunicacion
Copy link
Author

climascomunicacion commented Mar 18, 2021

Hi Peter, I try to execute

php artisan sitemap:generate

But it doesn't works.

There are no commands defined in the "generate" namespace.

@spekulatius
Copy link
Member

spekulatius commented Mar 18, 2021

This should work without service provider export. What is your output for php artisan?

@climascomunicacion
Copy link
Author

Laravel Framework 8.33.1

Usage:
command [options] [arguments]

Options:
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
clear-compiled Remove the compiled class file
db Start a new database CLI session
down Put the application into maintenance / demo mode
env Display the current framework environment
help Display help for a command
inspire Display an inspiring quote
list List commands
migrate Run the database migrations
optimize Cache the framework bootstrap files
serve Serve the application on the PHP development server
test Run the application tests
tinker Interact with your application
up Bring the application out of maintenance mode
auth
auth:clear-resets Flush expired password reset tokens
cache
cache:clear Flush the application cache
cache:forget Remove an item from the cache
cache:table Create a migration for the cache database table
config
config:cache Create a cache file for faster configuration loading
config:clear Remove the configuration cache file
db
db:seed Seed the database with records
db:wipe Drop all tables, views, and types
event
event:cache Discover and cache the application's events and listeners
event:clear Clear all cached events and listeners
event:generate Generate the missing events and listeners based on registration
event:list List the application's events and listeners
key
key:generate Set the application key
make
make:cast Create a new custom Eloquent cast class
make:channel Create a new channel class
make:command Create a new Artisan command
make:component Create a new view component class
make:controller Create a new controller class
make:event Create a new event class
make:exception Create a new custom exception class
make:factory Create a new model factory
make:job Create a new job class
make:listener Create a new event listener class
make:mail Create a new email class
make:middleware Create a new middleware class
make:migration Create a new migration file
make:model Create a new Eloquent model class
make:notification Create a new notification class
make:observer Create a new observer class
make:policy Create a new policy class
make:provider Create a new service provider class
make:request Create a new form request class
make:resource Create a new resource
make:rule Create a new validation rule
make:seeder Create a new seeder class
make:test Create a new test class
migrate
migrate:fresh Drop all tables and re-run all migrations
migrate:install Create the migration repository
migrate:refresh Reset and re-run all migrations
migrate:reset Rollback all database migrations
migrate:rollback Rollback the last database migration
migrate:status Show the status of each migration
notifications
notifications:table Create a migration for the notifications table
optimize
optimize:clear Remove the cached bootstrap files
package
package:discover Rebuild the cached package manifest
queue
queue:batches-table Create a migration for the batches database table
queue:clear Delete all of the jobs from the specified queue
queue:failed List all of the failed queue jobs
queue:failed-table Create a migration for the failed queue jobs database table
queue:flush Flush all of the failed queue jobs
queue:forget Delete a failed queue job
queue:listen Listen to a given queue
queue:prune-batches Prune stale entries from the batches database
queue:restart Restart queue worker daemons after their current job
queue:retry Retry a failed queue job
queue:retry-batch Retry the failed jobs for a batch
queue:table Create a migration for the queue jobs database table
queue:work Start processing jobs on the queue as a daemon
route
route:cache Create a route cache file for faster route registration
route:clear Remove the route cache file
route:list List all registered routes
sail
sail:install Install Laravel Sail's default Docker Compose file
sail:publish Publish the Laravel Sail Docker files
schedule
schedule:list List the scheduled commands
schedule:run Run the scheduled commands
schedule:test Run a scheduled command
schedule:work Start the schedule worker
schema
schema:dump Dump the given database schema
session
session:table Create a migration for the session database table
sitemap
sitemap:generate Crawl the site and generate the sitemap.xml file
storage
storage:link Create the symbolic links configured for the application
stub
stub:publish Publish all stubs that are available for customization
translatable
translatable:export Export translatable strings for a language to a JSON file.
translatable:inspect-translations Scan a language file for unstranslated string and display them in the console.
vendor
vendor:publish Publish any publishable assets from vendor packages
view
view:cache Compile all of the application's Blade templates
view:clear Clear all compiled view files

@spekulatius
Copy link
Member

It is listed, strange.

@climascomunicacion
Copy link
Author

OK i saw the problem:

The right command is:

php artisan sitemap:generate

and i was executing

php artisan generate:sitemap

Because i was following this tutorial where they was writing it in the wrong way:
https://peterthaleikis.com/posts/how-to-generate-a-laravel-sitemap-dynamically/

@climascomunicacion
Copy link
Author

After executing php artisan sitemap:generate it generates the file public/sitemap.xml with this content:

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"/>

Is this how it must work or should it index more content of my website?

@spekulatius
Copy link
Member

OK i saw the problem:

The right command is:

php artisan sitemap:generate

and i was executing

php artisan generate:sitemap

Because i was following this tutorial where they was writing it in the wrong way:
https://peterthaleikis.com/posts/how-to-generate-a-laravel-sitemap-dynamically/

Oh, okay. Now I understand. At the very beginning, I had it with generate:sitemap instead of sitemap:generate. Sorry about this. I've fixed this.

@spekulatius
Copy link
Member

After executing php artisan sitemap:generate it generates the file public/sitemap.xml with this content:

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"/>

Is this how it must work or should it index more content of my website?

Did you set a APP_URL in your .env file?

@solamichealolawale
Copy link

I am having the same issue with @climascomunicacion
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"/>

That is the content of the sitemap and yes APP_URL is set in my .env file

@spekulatius
Copy link
Member

I am having the same issue with @climascomunicacion
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"/>

That is the content of the sitemap and yes APP_URL is set in my .env file

Can you share the output of the sitemap generation command @solamichealolawale ?

@solamichealolawale
Copy link

I am having the same issue with @climascomunicacion
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"/>
That is the content of the sitemap and yes APP_URL is set in my .env file

Can you share the output of the sitemap generation command @solamichealolawale ?

image
This is what I got

@spekulatius
Copy link
Member

spekulatius commented Mar 30, 2021

Is the site actually available under pay4me.oo or is it a different host @solamichealolawale ?

@solamichealolawale
Copy link

Yes, i'm using auto virtual host locally
So it's both available on localhost/pay4me/public and also pay4me.oo

@spekulatius
Copy link
Member

It's it directly under https://pay4me.oo or a different host name @solamichealolawale ?

@solamichealolawale
Copy link

Yes it's under https://pay4me.oo

@spekulatius
Copy link
Member

Can you post the robots.txt?

@solamichealolawale
Copy link

Can you post the robots.txt?

User-agent: *
Disallow:

@spekulatius
Copy link
Member

This isn't what I get with https://pay4me.oo/robots.txt. I'll add more detailed output into the package to allow better debugging later today.

@solamichealolawale
Copy link

The https://pay4me.oo/robots.txt is a local project, you can't acess it from your side. Unless I push to the production server

@spekulatius
Copy link
Member

Ah okay, yeah - makes sense. I didn't get anything back. I'll add some debugging to get to the ground of this...

@solamichealolawale
Copy link

Alright then

@spekulatius
Copy link
Member

Hello @solamichealolawale

sorry for the delay. I got busy. I've pushed branch with additional debugging. Can you install it and print the output?

Also: Can you run the package on production? I've noticed my local crawling not including any pages (not sure why yet) but on production it includes everything.

@solamichealolawale
Copy link

solamichealolawale commented Apr 12, 2021

I downloaded the debugging branch and copied it to the vendor folder and I ran the command and it is showing the same thing
image

I tried it on production and it's still the same thing.
https://pay4me.app/sitemap.xml

@spekulatius
Copy link
Member

spekulatius commented Apr 12, 2021 via email

@spekulatius
Copy link
Member

I tried it on production and it's still the same thing.
https://pay4me.app/sitemap.xml

This doesn't match the hostname in the output...

@solamichealolawale
Copy link

Hmmm, it looks like your hosts don't match up. Which version to use depends on your environment of the time, a stable version (release) unless you are debugging as we do now.

On Mon, 12 Apr 2021 at 12:03, Olusola Olawale @.***> wrote: I downloaded the debugging branch and copied it to the vendor folder and I ran the command and it is showing the same thing [image: image] https://user-images.githubusercontent.com/12444227/114361265-d7407b80-9b6d-11eb-8fd9-e1498390e859.png Concerning the package, which one should I use on production? Master or debugging? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAK7M7M3OOEAPBATHVIGSDTIKSOLANCNFSM4ZNBEXHQ .

I used "bringyourownideas/laravel-sitemap": "^2.1"

@spekulatius
Copy link
Member

Hey @solamichealolawale

If the host name doesn't match, it won't work. This might happen locally. Is this from production?

image

Cheers,
Peter

@Lilyah
Copy link

Lilyah commented May 7, 2021

Hi, @spekulatius

I'm using Laravel 7.3
I have the same issue as @climascomunicacion. When I run
php artisan vendor:publish --provider="BringYourOwnIdeas\LaravelSitemap\SitemapServiceProvider"
it shows
Unable to locate publishable resources.

Also when I run
composer require bringyourownideas/laravel-sitemap
it installs v 1.0, not the latest 2.1.

Regards,
Lilly

@spekulatius
Copy link
Member

Hello @Lilyah,

It's not strictly needed to publish the provider. What is your goal in publishing it?

Cheers,
Peter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants