Closed jamestagal closed 1 year ago
Thanks for flagging this @jamestagal. I've seen a couple of weird builds since I've changed the internals around. I'm going to be doing some additional restructuring of the build in the near future (https://github.com/plentico/plenti/issues/255) to make improvements there so that might resolve some of these issues. If you can pinpoint what's causing this, just let me know! Thanks!
Hi @jimafisk Yes sure.
I have got another error, the same twice now but it is different to the one listed above. See below:
2023/01/13 14:34:35 build.go:147:
Error in Client build step
Could not get all layouts Could not add SSR Component for layouts/content/blog.svelte: SyntaxError: Identifier 'postsPerPage' has already been declared
Both times I added a
tags to images and it happened on saving the changes. So immediately after saving. Below is a link to the last push to GitHub with this change. Again once I run plenti serve
after it builds just fine without any errors so it is a little hard to pin point.
https://github.com/jamestagal/plenti-educenter/commit/bacb4f023907bc51c8609d59e40eb7917e1ff9bf
Just thought I should let you know.
Ben
UPDATE: Yes it is happening each time I save any change. Two difference error messages:
Could not compile 'core/cms/add_content.svelte' Svelte component: Unable to write compiled client file: open public/spa/core/cms/add_content.js: no such file or directory
2023/01/13 15:05:39 build.go:115:
Can't remove "%v" folder from previous buildunlinkat ./public: directory not emptypublic
2023/01/13 14:34:35 build.go:147:
Error in Client build step
Could not get all layouts Could not add SSR Component for layouts/content/blog.svelte: SyntaxError: Identifier 'postsPerPage' has already been declared
Hi @jamestagal,
I believe the Can't remove "%v" folder from previous build
error was happening if two save events happened in a row (some editors do this automatically). I tried making some improvements to the batching process in the file watcher, so I think this might be fixed in v0.6.13, can you test when you get a chance and let me know if this is working any better on your end?
Hi @jimafisk
After updating to Plenti version v0.6.13 I haven't had any errors for consecutive saves though I do notice a difference when was in the Fitlife theme. In the terminal output, any time you even click in and around in the code of the project, it runs a Change detected, rebuilding site
which seems a little excessive. especially when I am not saving just clicking aound.
Then I got the following error.
Thanks for the bug report @jamestagal! It sounds like the editor is doing some sort of temporary writes to the filesystem. Can you remind me which editor (vscode?) and operating system (windows?) you're using? Also if you can try passing the -v
flag like plenti serve -v
and copy which file changes are being detected that would be great! Thank you!
Hi @jimafisk No worries. I am using VS Code on my Mac Mini with M1 chip.
macOS Monterey
System Version: macOS 12.6.3 Kernel Version: Darwin 21.6.0
Here are a few minutes of logs with the V flag.
Then a couple minutes later it crashed
Hi @jimafisk what is interesting is that this constant rebuilding only seems to be happening to the Fitlife theme ..I have tried others such as my Compendium, Educenter, Bigspring and I don't get that behaviour at all. So it might be something particular about how that theme is set up maybe?
Also I can't seem to login to the CMS now...don't know whether that is a result of this update or not...but I have had a couple of themes that I couldn't login to recently. I am just using the #login
method. I also wondered whether you could include the scaffolding for the login into the project by default? When I started with a bare
Plenti project recently I noticed the login component wasn't included. It would make it so much easier to get up and running with the CMS functionality in a default project with it already configured.
Regard, Ben
Thanks for sending the logs with the -v
flag. I expected to see some additional details about which files specifically are being changed, not sure why that didn't come through :thinking:
I suspect that it might have something to do with Mac adding .DS_Store
files (Desktop Services Store). It probably makes sense to start ignoring all "dot" files in the watcher because various operating systems and editors add these, for instance vim adds "swap" files, which may be part of the problem here: https://github.com/plentico/plenti/issues/109#issuecomment-1571219993
what is interesting is that this constant rebuilding only seems to be happening to the Fitlife theme
That is definitely interesting, I wonder if the other project already have .DS_Store
files in them because you worked on them recently? I just tried editing fitlife locally on Linux with vim and it didn't have any issues.
I can't seem to login to the CMS now... I am just using the #login method
Is the popup not showing up at all? This is likely because of the Svelte upgrade if your node_modules
still has the older version downloaded. If that's the case you might have an error like this in your browser console:
Uncaught SyntaxError: The requested module '../../web_modules/svelte/internal/index.mjs' does not provide an export named 'append_hydration' (at footer.js:1:24)
CMS Fix: If that's the case you can simply delete your node_modules
folder and rerun plenti serve
and that should clear things up.
I also wondered whether you could include the scaffolding for the login into the project by default? When I started with a bare Plenti project recently I noticed the login component wasn't included
We could certainly add something like this to the learner
starter - we use this to demonstrate features and give folks examples of things they could implement in their own projects. The #login
modal approach is just one of many different ways to do logins, it's possible this won't even the most popular approach. I'm trying to avoid putting implementation details into the bare
starter because I want to avoid forcing folks to tear out things they don't want to use every time they start a project. For logins, all you really need is a click handler to fire $user.login()
, this could be a simple link on a page if you'd like. Hope that makes sense!
Hi @jimafisk
After upgrading to v0.6.17 I still get the site rebuilding when clicking around again in the Fitlife theme..only :) again other theme aren't doing this. so it might not be .DS_Stores
file issue.
Thanks for your responses about the login
to the CMS. I haven't tried as yet but I will try tonight.
Another console log that I am seeing from my site after deleting the node_modules
is as follows:
Hi @jimafisk
I tried your suggestion above and deleted the node_modules
folder and that worked in most cases to authenticate for the CMS, thanks, but for some unknown reason i couldn't with the Apsho theme that is still in development to connect me to the CMS. Pls take a quick look when you are free.
Best regards, Ben
After upgrading to v0.6.17 I still get the site rebuilding when clicking around again in the Fitlife theme..only
So strange! I can't seem to replicate this on my end with the Fitlife theme. Do you have unsaved changes, or are you able to reclone the repo to see if that clears things up?
I tried your suggestion above and deleted the node_modules folder and that worked in most cases to authenticate for the CMS
Awesome :sunglasses:
for some unknown reason i couldn't with the Apsho theme that is still in development to connect me to the CMS
Really nice looking theme @jamestagal! I see a couple of font / icon loading issues that might be blocking this, can you give me write access to the repo so I can push up some changes? Thanks!
Looks like you already gave me access! Thanks!
Pushed a commit that fixes a couple of things: https://github.com/jamestagal/plenti-apsho/commit/15421e0d043796d75e710f26bcf6d456c27c0379
Hi @jimafisk
Thanks. I pulled in your commit but unfortunately when serving the site..I get a 404 page not found
error.
Pls test it on your site when you can.
Cheers, Ben
Hi @jamestagal, Just want to double check that you're going to http://localhost:3000/apsho/ not http://localhost:3000/ right? I think this site uses a baseurl. Thanks!
Yes I am.. Are you getting the same error message?
Ben
No, it seems to work fine on my end. Is a public
build folder getting created at all? Are there any html files in it?
Hi @jimafisk
It is serving fine now. I just closed everything down and reopened and it worked. there might have been a conflct with another Plenti theme project I had open and on the same port localhost:3000
😊
So all good thanks.
Hi @jimafisk
Just another one while I'm here is an A11y error I have been seeing in the nav.svelte
files of all of these themes since your latest upgrade is as follows:
Do you know how to fix this one?
Sorry to clarify this same error is happening in the login.svelte
files of the other themes. The screenshot above is in the Apsho theme but in the nav.svelte
file.
Ben
I think the items on this thread have been addressed so I'm closing this issue.
The "A11y" warnings are accessibility suggestions that the Svelte language tools are suggesting to you. That particular warning happens when you put an on:click
handler onto an element that isn't usually interactive when clicked (for example a <div>
). You could just change this to an element that is expected to handled clicks (for example a <button>
).
Hi @jimafisk
I just wanted to report this error. Unexpectedly this morning after pushing some changes to Github I got the following error. It only happened the one time and I was able to re-run and serve the site as if nothing had happened. So maybe just something to monitor for now unless you can see what might have caused it.
NOTE: I have upgraded to the latest release v0.6.0. The error happened in the educenter theme
Regards, Ben