plentico / plenti

Static Site Generator with Go backend and Svelte frontend
https://plenti.co
Apache License 2.0
1.01k stars 49 forks source link

Can't remove "%v" folder from previous buildunlinkat ./public: directory not emptypublic #261

Closed jamestagal closed 1 year ago

jamestagal commented 1 year ago

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

Serving site from your "public" directory.
Visit your site at http://localhost:3000/
Could not compile 'core/cms/fields/radio.svelte' Svelte component: Unable to write compiled client file: open public/spa/core/cms/fields/radio.js: no such file or directory
2023/01/13 08:16:21 build.go:115: 
Can't remove "%v" folder from previous buildunlinkat ./public: directory not emptypublic

Regards, Ben

jimafisk commented 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!

jamestagal commented 1 year ago

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:

  1. The following error happened when saving this change https://github.com/jamestagal/plenti-educenter/commit/8c8090ba7da5176e8320842b726f135ecb41e979.
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
  1. The following error happened when saving this change https://github.com/jamestagal/plenti-educenter/commit/a383561643b4bdbd0959da6688e928c61ca62272
    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
jimafisk commented 1 year ago

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?

jamestagal commented 1 year ago

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.

First crash log ```terminal <--- Last few GCs ---> [1663:0x150400000] 648 ms: Mark-sweep (reduce) 8.3 (27.2) -> 8.3 (10.2) MB, 3.4 / 0.0 ms (average mu = 0.148, current mu = 0.024) last resort GC in old space requested [1663:0x150400000] 651 ms: Mark-sweep (reduce) 8.3 (10.2) -> 8.3 (9.9) MB, 2.5 / 0.0 ms (average mu = 0.082, current mu = 0.000) last resort GC in old space requested <--- JS stacktrace ---> # # Fatal javascript OOM in CALL_AND_RETRY_LAST # SIGTRAP: trace trap PC=0x1028bbb94 m=11 sigcode=0 signal arrived during cgo execution goroutine 23 [syscall]: runtime.cgocall(0x102899c2c, 0x140002b2d68) /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/cgocall.go:157 +0x54 fp=0x140002b2d30 sp=0x140002b2cf0 pc=0x102376574 rogchap.com/v8go._Cfunc_RunScript(0x12da2e0a0, 0x15cf54600, 0x15c03f9e0) _cgo_gotypes.go:1220 +0x40 fp=0x140002b2d60 sp=0x140002b2d30 pc=0x102656430 rogchap.com/v8go.(*Context).RunScript.func3(0x15c03f9e0?, 0xe?, 0x1400011e270?) /home/runner/go/pkg/mod/rogchap.com/v8go@v0.8.0/context.go:99 +0x6c fp=0x140002b2dd0 sp=0x140002b2d60 pc=0x1026594ac rogchap.com/v8go.(*Context).RunScript(0x1400000e3d8, {0x1400002d800?, 0x140002b3258?}, {0x10360ea45, 0xe}) /home/runner/go/pkg/mod/rogchap.com/v8go@v0.8.0/context.go:99 +0x98 fp=0x140002b2e40 sp=0x140002b2dd0 pc=0x102659338 github.com/plentico/plenti/cmd/build.compileSvelte(0x12cae96a8?, 0x14000038120?, {0x14000143c40, 0x20}, {0x14000024800, 0x40eb}, {0x140004a0c60, 0x27}, {0x1400015d3b0, 0x15}) /home/runner/work/plenti/plenti/cmd/build/compile.go:55 +0x178 fp=0x140002b3330 sp=0x140002b2e40 pc=0x1026f7198 github.com/plentico/plenti/cmd/build.Client.func1({0x14000143c40, 0x20}, {0x104f83770?, 0x104f88e08?}, {0x0?, 0x0?}) /home/runner/work/plenti/plenti/cmd/build/client.go:129 +0x474 fp=0x140002b34b0 sp=0x140002b3330 pc=0x1026f5c84 io/fs.walkDir({0x104f7efc8, 0x104f88880}, {0x14000143c40, 0x20}, {0x104f83770, 0x104f88e08}, 0x140002b3988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:66 +0x5c fp=0x140002b3570 sp=0x140002b34b0 pc=0x1024329fc io/fs.walkDir({0x104f7efc8, 0x104f88880}, {0x140000a9690, 0xf}, {0x104f83770, 0x104f88ad8}, 0x140002b3988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:85 +0x1f4 fp=0x140002b3630 sp=0x140002b3570 pc=0x102432b94 io/fs.walkDir({0x104f7efc8, 0x104f88880}, {0x140001b48e8, 0x8}, {0x104f83770, 0x104f888c8}, 0x140002b3988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:85 +0x1f4 fp=0x140002b36f0 sp=0x140002b3630 pc=0x102432b94 io/fs.walkDir({0x104f7efc8, 0x104f88880}, {0x103606c16, 0x4}, {0x104f83968, 0x140005d61d0}, 0x140002b3988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:85 +0x1f4 fp=0x140002b37b0 sp=0x140002b36f0 pc=0x102432b94 io/fs.WalkDir({0x104f7efc8, 0x104f88880}, {0x103606c16, 0x4}, 0x1400035d988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:112 +0xc8 fp=0x140002b3820 sp=0x140002b37b0 pc=0x102432cf8 github.com/plentico/plenti/cmd/build.Client({0x14000038120, 0x6}, {0x0?}, {0x140000380c8?}) /home/runner/work/plenti/plenti/cmd/build/client.go:89 +0x3c4 fp=0x140002b3ad0 sp=0x140002b3820 pc=0x1026f51b4 github.com/plentico/plenti/cmd.Build() /home/runner/work/plenti/plenti/cmd/build.go:150 +0x658 fp=0x140002b3ea0 sp=0x140002b3ad0 pc=0x102892c08 github.com/plentico/plenti/cmd/serve.(*watcher).watch.func1() /home/runner/work/plenti/plenti/cmd/serve/watcher.go:85 +0x1ec fp=0x140002b3fd0 sp=0x140002b3ea0 pc=0x10277b0bc runtime.goexit() /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/asm_arm64.s:1270 +0x4 fp=0x140002b3fd0 sp=0x140002b3fd0 pc=0x1023d6594 created by github.com/plentico/plenti/cmd/serve.(*watcher).watch /home/runner/work/plenti/plenti/cmd/serve/watcher.go:69 +0x370 goroutine 1 [IO wait, 8 minutes]: internal/poll.runtime_pollWait(0x12caad420, 0x72) /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/netpoll.go:302 +0xa4 internal/poll.(*pollDesc).wait(0x14000324600?, 0x4?, 0x0) /opt/hostedtoolcache/go/1.18.10/x64/src/internal/poll/fd_poll_runtime.go:83 +0x2c internal/poll.(*pollDesc).waitRead(...) /opt/hostedtoolcache/go/1.18.10/x64/src/internal/poll/fd_poll_runtime.go:88 internal/poll.(*FD).Accept(0x14000324600) /opt/hostedtoolcache/go/1.18.10/x64/src/internal/poll/fd_unix.go:614 +0x1d0 net.(*netFD).accept(0x14000324600) /opt/hostedtoolcache/go/1.18.10/x64/src/net/fd_unix.go:172 +0x28 net.(*TCPListener).accept(0x140001295c0) /opt/hostedtoolcache/go/1.18.10/x64/src/net/tcpsock_posix.go:139 +0x2c net.(*TCPListener).Accept(0x140001295c0) /opt/hostedtoolcache/go/1.18.10/x64/src/net/tcpsock.go:288 +0x30 net/http.(*Server).Serve(0x14000315880, {0x104f82e68, 0x140001295c0}) /opt/hostedtoolcache/go/1.18.10/x64/src/net/http/server.go:3039 +0x318 net/http.(*Server).ListenAndServe(0x14000315880) /opt/hostedtoolcache/go/1.18.10/x64/src/net/http/server.go:2968 +0x88 net/http.ListenAndServe(...) /opt/hostedtoolcache/go/1.18.10/x64/src/net/http/server.go:3222 github.com/plentico/plenti/cmd.glob..func6(0x10531e600?, {0x105384b68, 0x0, 0x0}) /home/runner/work/plenti/plenti/cmd/serve.go:148 +0x65c github.com/spf13/cobra.(*Command).execute(0x10531e600, {0x105384b68, 0x0, 0x0}) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x4ac github.com/spf13/cobra.(*Command).ExecuteC(0x10531e380) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x34c github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897 github.com/plentico/plenti/cmd.Execute() /home/runner/work/plenti/plenti/cmd/root.go:48 +0x2c main.main() /home/runner/work/plenti/plenti/main.go:7 +0x20 goroutine 37 [syscall]: syscall.syscall6(0x4?, 0x14000686d00?, 0x2?, 0x0?, 0x100000000000000?, 0x0?, 0x2?) /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/sys_darwin.go:45 +0x64 golang.org/x/sys/unix.kevent(0x1400035daa0?, 0x0?, 0x0?, 0x140003fc0a0?, 0x14000686dc4?, 0x140004e2b60?) /home/runner/go/pkg/mod/golang.org/x/sys@v0.5.0/unix/zsyscall_darwin_arm64.go:276 +0x5c golang.org/x/sys/unix.Kevent(0x140003fc060?, {0x0?, 0x140004e2ca8?, 0x1023b9250?}, {0x14000686e68?, 0x102778d20?, 0x2?}, 0x14000686dc4?) /home/runner/go/pkg/mod/golang.org/x/sys@v0.5.0/unix/syscall_bsd.go:399 +0x44 github.com/fsnotify/fsnotify.read(0x14000686e28?, {0x14000686e68?, 0x50?, 0xa}, 0x105384d20?) /home/runner/go/pkg/mod/github.com/fsnotify/fsnotify@v1.5.4/kqueue.go:525 +0x48 github.com/fsnotify/fsnotify.(*Watcher).readEvents(0x14000321920) /home/runner/go/pkg/mod/github.com/fsnotify/fsnotify@v1.5.4/kqueue.go:288 +0x78 created by github.com/fsnotify/fsnotify.NewWatcher /home/runner/go/pkg/mod/github.com/fsnotify/fsnotify@v1.5.4/kqueue.go:63 +0x1ac goroutine 38 [chan receive, 8 minutes]: github.com/plentico/plenti/cmd/serve.(*watcher).watch(0x14000130018, {0x140000385e8, 0x6}, 0x104f7a418) /home/runner/work/plenti/plenti/cmd/serve/watcher.go:97 +0x37c github.com/plentico/plenti/cmd/serve.Gowatch.func1() /home/runner/work/plenti/plenti/cmd/serve/watcher.go:36 +0xac created by github.com/plentico/plenti/cmd/serve.Gowatch /home/runner/work/plenti/plenti/cmd/serve/watcher.go:32 +0x108 r0 0x34 r1 0x0 r2 0x120a8 r3 0x16e74aa9c r4 0x104d458e5 r5 0x16e74afc0 r6 0xa r7 0x1 r8 0x1 r9 0x1eddb5b20 r10 0x2 r11 0xfffffffd r12 0x10000000000 r13 0x0 r14 0x0 r15 0x0 r16 0x194e1b454 r17 0x1eef75968 r18 0x0 r19 0x15040d552 r20 0x1 r21 0x150400000 r22 0x15040c250 r23 0x16e7536b8 r24 0x16e75379e r25 0x16e74b008 r26 0x2 r27 0x8 r28 0x15040c400 r29 0x16e74afb0 lr 0x1028ca980 sp 0x16e74afb0 pc 0x1028bbb94 fault 0x1028bbb94 ~/Pr/P/fitlife  main !1  ```
jimafisk commented 1 year ago

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!

jamestagal commented 1 year ago

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.

Logs with -v flag plenti serve -v Checking if 'node_modules' directory exists. Removing old 'public' build directory █▒▒▒▒▒▒▒▒▒ Building... Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte █████▒▒▒▒▒ Building... Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.302553875s Serving site from your "public" directory. Visit your site at http://localhost:3000/fitlife/ Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.250678209s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.250163916s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.253585333s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.250383375s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.293674667s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.2410675s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.245682917s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.229114875s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.276734667s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.279106417s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.262449417s Change detected, rebuilding site Checking if 'node_modules' directory exists. Removing old 'public' build directory Creating 'public' build directory Copying ejectable core files to their destination: Number of ejectable core files copied: 12 Copying static files: Number of static files copied: 3 Copying media files: Number of media files copied: 29 Compiling client SPA with svelte Number of components compiled: 12 Gathering data source from 'content/' folder Number of content files used: 4 Running gopack to build esm support for npm dependencies Running gopack to build esm support for npm dependencies Running Gopack manually on dynamic imports Running tdewolff/minify reduce size of build assets Total build took 1.271290666s

Then a couple minutes later it crashed

Last log Compiling client SPA with svelte <--- Last few GCs ---> [4024:0x158298000] 241 ms: Mark-sweep (reduce) 7.4 (17.2) -> 7.4 (8.9) MB, 3.4 / 0.0 ms (average mu = 0.093, current mu = 0.024) last resort GC in old space requested [4024:0x158298000] 244 ms: Mark-sweep (reduce) 7.4 (8.9) -> 7.4 (8.7) MB, 2.5 / 0.0 ms (average mu = 0.051, current mu = 0.000) last resort GC in old space requested <--- JS stacktrace ---> # # Fatal javascript OOM in CALL_AND_RETRY_LAST # SIGTRAP: trace trap PC=0x103433b94 m=13 sigcode=0 signal arrived during cgo execution goroutine 36 [syscall]: runtime.cgocall(0x103411c2c, 0x14000018e28) /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/cgocall.go:157 +0x54 fp=0x14000018df0 sp=0x14000018db0 pc=0x102eee574 rogchap.com/v8go._Cfunc_RunScript(0x1391e6000, 0x14bfbea00, 0x12db97390) _cgo_gotypes.go:1220 +0x40 fp=0x14000018e20 sp=0x14000018df0 pc=0x1031ce430 rogchap.com/v8go.(*Context).RunScript.func3(0x12db97390?, 0xe?, 0x1400022c0d0?) /home/runner/go/pkg/mod/rogchap.com/v8go@v0.8.0/context.go:99 +0x6c fp=0x14000018e90 sp=0x14000018e20 pc=0x1031d14ac rogchap.com/v8go.(*Context).RunScript(0x1400000e258, {0x14000234a00?, 0x14000019318?}, {0x104186a45, 0xe}) /home/runner/go/pkg/mod/rogchap.com/v8go@v0.8.0/context.go:99 +0x98 fp=0x14000018f00 sp=0x14000018e90 pc=0x1031d1338 github.com/plentico/plenti/cmd/build.compileSvelte(0x12d6896a8?, 0x140000381c0?, {0x1400003c4e0, 0x1a}, {0x140002bf000, 0x2cdb}, {0x1400003a5d0, 0x21}, {0x14000037158, 0x15}) /home/runner/work/plenti/plenti/cmd/build/compile.go:55 +0x178 fp=0x140000193f0 sp=0x14000018f00 pc=0x10326f198 github.com/plentico/plenti/cmd/build.Client.func1({0x1400003c4e0, 0x1a}, {0x105afb770?, 0x105b009b8?}, {0x0?, 0x0?}) /home/runner/work/plenti/plenti/cmd/build/client.go:129 +0x474 fp=0x14000019570 sp=0x140000193f0 pc=0x10326dc84 io/fs.walkDir({0x105af6fc8, 0x105b00880}, {0x1400003c4e0, 0x1a}, {0x105afb770, 0x105b009b8}, 0x14000019988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:66 +0x5c fp=0x14000019630 sp=0x14000019570 pc=0x102faa9fc io/fs.walkDir({0x105af6fc8, 0x105b00880}, {0x140000381f8, 0x8}, {0x105afb770, 0x105b008c8}, 0x14000019988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:85 +0x1f4 fp=0x140000196f0 sp=0x14000019630 pc=0x102faab94 io/fs.walkDir({0x105af6fc8, 0x105b00880}, {0x10417ec16, 0x4}, {0x105afb968, 0x14000414230}, 0x14000019988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:85 +0x1f4 fp=0x140000197b0 sp=0x140000196f0 pc=0x102faab94 io/fs.WalkDir({0x105af6fc8, 0x105b00880}, {0x10417ec16, 0x4}, 0x14000019988) /opt/hostedtoolcache/go/1.18.10/x64/src/io/fs/walk.go:112 +0xc8 fp=0x14000019820 sp=0x140000197b0 pc=0x102faacf8 github.com/plentico/plenti/cmd/build.Client({0x140000381c0, 0x6}, {0x0?}, {0x14000038168?}) /home/runner/work/plenti/plenti/cmd/build/client.go:89 +0x3c4 fp=0x14000019ad0 sp=0x14000019820 pc=0x10326d1b4 github.com/plentico/plenti/cmd.Build() /home/runner/work/plenti/plenti/cmd/build.go:150 +0x658 fp=0x14000019ea0 sp=0x14000019ad0 pc=0x10340ac08 github.com/plentico/plenti/cmd/serve.(*watcher).watch.func1() /home/runner/work/plenti/plenti/cmd/serve/watcher.go:85 +0x1ec fp=0x14000019fd0 sp=0x14000019ea0 pc=0x1032f30bc runtime.goexit() /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/asm_arm64.s:1270 +0x4 fp=0x14000019fd0 sp=0x14000019fd0 pc=0x102f4e594 created by github.com/plentico/plenti/cmd/serve.(*watcher).watch /home/runner/work/plenti/plenti/cmd/serve/watcher.go:69 +0x370 goroutine 1 [IO wait, 5 minutes]: internal/poll.runtime_pollWait(0x12dca69f8, 0x72) /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/netpoll.go:302 +0xa4 internal/poll.(*pollDesc).wait(0x140002ac600?, 0x105a9faa0?, 0x0) /opt/hostedtoolcache/go/1.18.10/x64/src/internal/poll/fd_poll_runtime.go:83 +0x2c internal/poll.(*pollDesc).waitRead(...) /opt/hostedtoolcache/go/1.18.10/x64/src/internal/poll/fd_poll_runtime.go:88 internal/poll.(*FD).Accept(0x140002ac600) /opt/hostedtoolcache/go/1.18.10/x64/src/internal/poll/fd_unix.go:614 +0x1d0 net.(*netFD).accept(0x140002ac600) /opt/hostedtoolcache/go/1.18.10/x64/src/net/fd_unix.go:172 +0x28 net.(*TCPListener).accept(0x140001296b0) /opt/hostedtoolcache/go/1.18.10/x64/src/net/tcpsock_posix.go:139 +0x2c net.(*TCPListener).Accept(0x140001296b0) /opt/hostedtoolcache/go/1.18.10/x64/src/net/tcpsock.go:288 +0x30 net/http.(*Server).Serve(0x1400029b880, {0x105afae68, 0x140001296b0}) /opt/hostedtoolcache/go/1.18.10/x64/src/net/http/server.go:3039 +0x318 net/http.(*Server).ListenAndServe(0x1400029b880) /opt/hostedtoolcache/go/1.18.10/x64/src/net/http/server.go:2968 +0x88 net/http.ListenAndServe(...) /opt/hostedtoolcache/go/1.18.10/x64/src/net/http/server.go:3222 github.com/plentico/plenti/cmd.glob..func6(0x105e96600?, {0x1400020b250, 0x0, 0x1}) /home/runner/work/plenti/plenti/cmd/serve.go:148 +0x65c github.com/spf13/cobra.(*Command).execute(0x105e96600, {0x1400020b240, 0x1, 0x1}) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x4ac github.com/spf13/cobra.(*Command).ExecuteC(0x105e96380) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x34c github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897 github.com/plentico/plenti/cmd.Execute() /home/runner/work/plenti/plenti/cmd/root.go:48 +0x2c main.main() /home/runner/work/plenti/plenti/main.go:7 +0x20 goroutine 7 [syscall]: syscall.syscall6(0x4?, 0x14000082d00?, 0x2?, 0x0?, 0x0?, 0x0?, 0x2?) /opt/hostedtoolcache/go/1.18.10/x64/src/runtime/sys_darwin.go:45 +0x64 golang.org/x/sys/unix.kevent(0x0?, 0x0?, 0x2e498be1?, 0xbc0215d95d1?, 0x14000082dc4?, 0x1032f1dc8?) /home/runner/go/pkg/mod/golang.org/x/sys@v0.5.0/unix/zsyscall_darwin_arm64.go:276 +0x5c golang.org/x/sys/unix.Kevent(0x1400007e000?, {0x0?, 0x1400009b188?, 0x102f31250?}, {0x14000082e68?, 0x1032f0d20?, 0x2?}, 0x14000082dc4?) /home/runner/go/pkg/mod/golang.org/x/sys@v0.5.0/unix/syscall_bsd.go:399 +0x44 github.com/fsnotify/fsnotify.read(0x14000082e28?, {0x14000082e68?, 0x50?, 0xa}, 0x105efcd20?) /home/runner/go/pkg/mod/github.com/fsnotify/fsnotify@v1.5.4/kqueue.go:525 +0x48 github.com/fsnotify/fsnotify.(*Watcher).readEvents(0x140002a98c0) /home/runner/go/pkg/mod/github.com/fsnotify/fsnotify@v1.5.4/kqueue.go:288 +0x78 created by github.com/fsnotify/fsnotify.NewWatcher /home/runner/go/pkg/mod/github.com/fsnotify/fsnotify@v1.5.4/kqueue.go:63 +0x1ac goroutine 8 [chan receive, 5 minutes]: github.com/plentico/plenti/cmd/serve.(*watcher).watch(0x14000130018, {0x140000385c8, 0x6}, 0x105af2418) /home/runner/work/plenti/plenti/cmd/serve/watcher.go:97 +0x37c github.com/plentico/plenti/cmd/serve.Gowatch.func1() /home/runner/work/plenti/plenti/cmd/serve/watcher.go:36 +0xac created by github.com/plentico/plenti/cmd/serve.Gowatch /home/runner/work/plenti/plenti/cmd/serve/watcher.go:32 +0x108 r0 0x34 r1 0x0 r2 0x120a8 r3 0x16dceadec r4 0x1058bd8e5 r5 0x16dceb310 r6 0xa r7 0x1 r8 0x1 r9 0x1eddb5b20 r10 0x2 r11 0xfffffffd r12 0x10000000000 r13 0x0 r14 0x0 r15 0x0 r16 0x194e1b454 r17 0x1eef75968 r18 0x0 r19 0x1582a5552 r20 0x1 r21 0x158298000 r22 0x1582a4250 r23 0x16dcf3a08 r24 0x16dcf3aee r25 0x16dceb358 r26 0x2 r27 0x8 r28 0x1582a4400 r29 0x16dceb300 lr 0x103442980 sp 0x16dceb300 pc 0x103433b94 fault 0x103433b94
jamestagal commented 1 year ago

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

jimafisk commented 1 year ago

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!

jimafisk commented 1 year ago

@jamestagal is this any better with v0.6.17? Thanks!

jamestagal commented 1 year ago

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:

Screen Shot 2023-06-04 at 4 26 36 pm
jamestagal commented 1 year ago

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

jimafisk commented 1 year ago

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!

jimafisk commented 1 year ago

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

jamestagal commented 1 year ago

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

jimafisk commented 1 year ago

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!

jamestagal commented 1 year ago

Yes I am.. Are you getting the same error message?

Ben

jimafisk commented 1 year ago

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?

jamestagal commented 1 year ago

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.

jamestagal commented 1 year ago

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: Screen Shot 2023-06-07 at 11 05 44 pm

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

jimafisk commented 1 year ago

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>).