PricingBlog

issue with local storage in editor.

  • iconic4213-1479130275727540295

    Iconic

    8 hours ago

    I have an issue regarding local storage, im trying to generate a user session id and store it in the local storage then always call it to check the users sessions and use it for corresponding api calls but gfor some reason nordcraft isn't seeing it even when it shows in the dev console. tried all methods and ai keeps returning null errors and burns my credit regardless
    1
  • whitep4nth3r-1479132468505477282

    salma

    7 hours ago

    Are you able to provide us a link to your project or create a new project with a minimal reproduction?
  • whitep4nth3r-1479133660715417620

    salma

    7 hours ago

    sorry I meant the link to the project in the editor
  • whitep4nth3r-1479134592748224607

    salma

    7 hours ago

    can you provide a little information (or link to) where you're attempting to set local storage?
  • iconic4213-1479135017098678292

    Iconic

    7 hours ago

    the homepage. i tried setting a uuid into the local storage and then also calling it in an api
  • Tod-1479135018579132497

    Tod

    7 hours ago

    Great job @Iconic! Your contribution to the Nordcraft Community just made you advance to Community Level 3! 🌲
  • whitep4nth3r-1479135588639572109

    salma

    7 hours ago

    ok I can see it is being set

    Given that the Nordcraft editor renders your app in an iframe, you can't actually access local storage directly in the editor.

    now, where are you trying to retrieve it, so I can check that implementation
  • whitep4nth3r-1479135940063789086

    salma

    7 hours ago

    ah, you want to use the local storage value in an API

    local storage is only available on the client - just making sure that you're calling the API after the page has loaded?
  • local storage won't be available during server side rendering
  • iconic4213-1479136045714116608

    Iconic

    7 hours ago

    i was calling it on page load.
  • whitep4nth3r-1479136158939222098

    salma

    7 hours ago

    I see the on load event saves the session id to local storage and that it's working
  • where are you not seeing it when you need it?
  • iconic4213-1479136265193652446

    Iconic

    7 hours ago

    thats the question
  • it doesnt even work when i try to use it as an action
  • whitep4nth3r-1479136388623634534

    salma

    7 hours ago

    (well you won't see it in the editor when you "get it" because it's not available in the iframe)
  • iconic4213-1479136408055840799

    Iconic

    7 hours ago

    quite confusing
  • whitep4nth3r-1479136422014226535

    salma

    7 hours ago

    it's something you need to test in the preview tab
  • iconic4213-1479136605951230097

    Iconic

    7 hours ago

    when i test it in the preview it doesnt send it to the api also ecen when it shows in the console
  • whitep4nth3r-1479136705373143190

    salma

    7 hours ago

    can you link me directly to the place in the editor where you're trying to send it to the API please?
  • iconic4213-1479138917696409793

    Iconic

    7 hours ago

    in the nav component
  • whitep4nth3r-1479139598721482846

    salma

    7 hours ago

    ok, so that API is being called on page load, using auto fetch

    local storage will not be available when the API is called

    try calling the API in the on load lifecycle method, where local storage should be available
  • iconic4213-1479139751025180975

    Iconic

    7 hours ago

    ill try that now
  • whitep4nth3r-1479139909288595629

    salma

    7 hours ago

    (remember to also toggle auto fetch to off) and you'll need to make a workflow to call the API
  • from the on load method
  • iconic4213-1479140551260635377

    Iconic

    7 hours ago

    i also have an issue where someone on my team cant add a domain
  • whitep4nth3r-1479140607174639647

    salma

    7 hours ago

    paging @Erik Beuschau about that
  • iconic4213-1479140633259278359

    Iconic

    7 hours ago

    1479140632818618398-Scherm_afbeelding_2026-03-05_om_16.07.07.png
  • getting this error
  • iconic4213-1479150749719068845

    Iconic

    6 hours ago

    same as using the ai not getting any result or changes and it just randomly deletes any previous action or changes without doing anything lol and i still lose my credits. scared of getting another
  • whitep4nth3r-1479153188220440587

    salma

    6 hours ago

    You won’t see a local storage value in the editor as I mentioned previously. What’s good to do in these cases in the editor is provide a fallback for the value to use in the editor, using the Default To formula.

    Why don’t you try working through it without the AI in the meantime?

    Sorry I’m not at my desk right now but I can help you further tomorrow if you don’t solve it by then.
  • iconic4213-1479153612134416476

    Iconic

    6 hours ago

    yeah just sorted it out.
  • iconic4213-1479153883904475156

    Iconic

    6 hours ago

    it works in the preview but not editor was able to reroute it with static data for testing and then rely on the local storage in preview. console log helps me to know if theres an issue
  • whitep4nth3r-1479153957535486074

    salma

    6 hours ago

    That sounds the right way to do it. Glad you figured it out!
  • iconic4213-1479154321643012119

    Iconic

    6 hours ago

    Thank You. still experiencing the issue regarding the domain though
  • whitep4nth3r-1479154558344101918

    salma

    6 hours ago

    Yes Erik will get back to you when he can.
  • erikbeus-1479160098210185306

    Erik Beuschau

    6 hours ago

    I’ll look into the domain issue asap and get back to you no later than tomorrow morning (CET) 👍
  • 865877932463620096-@Iconic
    erikbeus-1479208676915941507

    Erik Beuschau

    2 hours ago

    I'm not sure how this error is related to adding domains? It looks like an error that happened when fetching the number of requests for the project. I'll look into the error. But it would be useful if you could provide more details about the issue about adding a domain.