Giter VIP home page Giter VIP logo

Comments (7)

nalmeida avatar nalmeida commented on June 14, 2024 1

Tks for the support @jimafisk!

from plenti.

jimafisk avatar jimafisk commented on June 14, 2024

The Failed to execute 'insertBefore' is due to adding configurable entrypoints via #211. It shouldn't prevent the CMS from working, but is something I plan on reverting in the near future to clear out the console errors and stop the site from flickering on load. There seems to be a bug with hydrating dynamic svelte components.

If you go to the http://localhost:3000/admin page and click the "login" button there, does it give you an admin toolbar? Thanks!

Edit: Also just a quick note, thank you for providing your system config (that's helpful 😊), but just FYI you shouldn't need NodeJS or NPM installed to run Plenti (they won't be used at all either way).

from plenti.

nalmeida avatar nalmeida commented on June 14, 2024

It does not. I seems that the JS error is preventing the button to work.

Steps to reproduce

  1. Launch $ plenti serve
  2. Navigate to http://localhost:3000/admin
  3. Click on "Login" button

Clicking on "Login" is not even firing a JS error on console.

from plenti.

jimafisk avatar jimafisk commented on June 14, 2024

Oh wait, I know what's happening here... Sorry this is my fault, I hastily updated the API before a talk I gave on Friday and didn't update the "starter" scaffolding code.

Basically what's happening is we removed the adminMenu prop because that's now included in the user prop. So in layouts/global/html.svelte you should change:

export let content, layout, allContent, allLayouts, env, user, adminMenu;

To:

export let content, layout, allContent, allLayouts, env, user;

and

{#if user && $user.isAuthenticated}
  <svelte:component this={adminMenu} {user} bind:content={content} />
{/if}

To:

{#if user && $user.isAuthenticated}
  <svelte:component this={$user.menu} {user} bind:content={content} />
{/if}

Does that work?

from plenti.

nalmeida avatar nalmeida commented on June 14, 2024

🎉 YES 🎉 it is working!

The original JS error still on console ...Failed to execute 'insertBefore' on 'Node':... but the admin is Working!

I was able to change content on pages and and also creating a new page!

I believe this fix should be applied on the repo.

from plenti.

jimafisk avatar jimafisk commented on June 14, 2024

Awesome 🎸

I just pushed a fix for this and I'll create a new release shortly.

I can fix the console error as well by removing the configurable entrypoint (#211). It would have been nice to keep that feature, but the console error and hydration flicker probably aren't worth the added benefit.

from plenti.

jimafisk avatar jimafisk commented on June 14, 2024

The starter scaffolding should be fixed in v0.6.8.

from plenti.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.