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

Local repository not recognizing posts from remote #35

Closed
refact0r opened this issue Jul 2, 2023 · 17 comments
Closed

Local repository not recognizing posts from remote #35

refact0r opened this issue Jul 2, 2023 · 17 comments
Assignees
Labels
bug Something isn't working

Comments

@refact0r
Copy link

refact0r commented Jul 2, 2023

I have a Sveltekit static site with Sveltia in a Github repo deployed on Netlify. The deployed version of Sveltia correctly recognizes all posts. However when I run the site in development mode locally and select "Work with local repository", Sveltia only displays the posts that were created using the local version. The posts that were pulled from the Github repo are not shown.

@kyoshino
Copy link
Member

kyoshino commented Jul 3, 2023

Thanks for flagging the issue! Listing files will be done differently when using the local workflow.

Is this your site in question? https://github.com/refact0r/forgotten-europe-website

@refact0r
Copy link
Author

refact0r commented Jul 3, 2023

Yes that is the site I am working on.

@kyoshino
Copy link
Member

kyoshino commented Jul 3, 2023

Okay, will check it out later!

@kyoshino kyoshino self-assigned this Jul 4, 2023
@kyoshino
Copy link
Member

kyoshino commented Jul 4, 2023

I’m running your SvelteKit project locally. I see all the content — 2 blog posts, 5 interviews and 7 images — on Svelta CMS. Not sure what’s going on 🤔 Did you reload /admin in your browser after fetching the content from remote?

@kyoshino kyoshino added the bug Something isn't working label Jul 4, 2023
@refact0r
Copy link
Author

refact0r commented Jul 6, 2023

Yes, I have tried reloading the page, clearing site data, restarting dev server. It seems that all images from remote load correctly, but blog posts, news articles, and the 1 interview not created locally do not show up.

@kyoshino
Copy link
Member

kyoshino commented Jul 6, 2023

Hmm, will check again.

@zanhk
Copy link

zanhk commented Nov 22, 2023

Got same problem in my repo https://github.com/zankhq/astro-starter/tree/chore/sveltia

@kyoshino
Copy link
Member

@zanhk Are you on Windows? To be honest, I’ve tested the local repo editing only on macOS, so there may be permission issues or something.

To clarify, changes made to local files are not automatically reflected in the CMS interface; you’ll need to reload the app to see any new external changes. Automatic updates will be possible in the (near) future when the new FileSystemObserver API is implemented in browsers.

@zanhk
Copy link

zanhk commented Nov 22, 2023

@kyoshino yes I m on windows, it asked for folder permissions and I gave it the whole repo folder access.

I've opened the admin ui with existing file (from the repo that was previously using decap cms) and I did not see them, I've created a new entry and it created the file succesffully, after restarting I could only see the created file and not the previous one.

As you mentioned could probably be a permission issue, I ll take a look when I ll have sometime but if it's only a local problem doesn't seem a big deal as it's always possibile to change those files directly, just mentioned as I was testing out the repo.

@kyoshino
Copy link
Member

Let me check with my Windows virtual machine later today.

@kyoshino
Copy link
Member

Testing on Windows 10 but cannot reproduce the issue. 🤔 🤔 🤔 Fetch the origin, reload the CMS, and then remote changes show up in the admin. I suspected it might be related to file paths because Windows uses a backslash as the separator, but not sure.

Has anyone noticed any difference between a file created locally and a file created remotely?

@kyoshino
Copy link
Member

Or perhaps line breaks, because Windows uses CR+LF while macOS/Linux/web uses LF.

@kyoshino
Copy link
Member

Now I could reproduce the issue. Figuring out why!

@kyoshino
Copy link
Member

kyoshino commented Nov 24, 2023

So line breaks are the culprit. 🤖 This kind of issue can be avoided by configuring the .gitattributes and .editorconfig files on a repository, but anyway, the problem could be easily solved in the CMS.

@kyoshino
Copy link
Member

The fix is in! Sorry to take this long 🙇🏼

@zanhk
Copy link

zanhk commented Nov 24, 2023

@kyoshino Awesome

@zanhk
Copy link

zanhk commented Nov 25, 2023

@kyoshino This works as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants