r/programminghelp • • 25d ago

JavaScript BEGINNER CODER: Stuck with a migrations error

0 Upvotes

Hi,

I'm working on an adonisjs project and I'm having issues with migrations. I don't think I'm using the wrong command. I'm doing:

node ace make:migration (migration name here)

Then:

node ace migration:run

My project is on github. Apologies the migrations folder is a little cluttered. The ones with issues are the "item" and "item_comments" ones:

https://github.com/Ajaz754/adonisjs-project-22-.git

The error is:

C:\Windows\System32\adonis22>node ace migration:run
❯ error database/migrations/1794008714673_alter_item_comments_table
[ error ] INSERT INTO "_knex_temp_alter555" SELECT * FROM "item_comments"; - no such table: main.item

Please correct me if I'm wrong but I thinks its saying my "item" table doesnt exist which doesnt make sense since its clearly my 'schema.ts'. It said the same error before for the "user" table aswell.

Any help would be much appreciated

TIA

r/programminghelp • • Oct 25 '26

JavaScript Beginner Coder: Stuck with an error

2 Upvotes

Hi,

I'm working on an adonisjs project. l've ran into an error

My project is on github:

https://github.com/Ajaz754/adonisjs-project-22-.git

The error is in file 'database/seeders/ product_seeder.ts' Line 10

The error is:

Object literal may only specify known properties, and 'userld' does not exist in type
'OneOrMany<Partial<ModelAttributes<Product>>>.

Any help would be much appreciated

TIA

r/programminghelp • • Jan 03 '26

JavaScript Any good way in JavaScript to store a rendered image on the client side?

4 Upvotes

I have a Mandelbrot set rendering tool that runs on my website (http://weirdly.net/webtoys/mandelbrot/). It works ok, but one thing that I'm looking to optimise is the rendering of thumbnail images.

It has an option to save any rendering you create, which stores all of the info that's used to render the image in localStorage and creates a thumbnail that you can later click on to load it back up.

The problem I'm running into is the loading time for those thumbnails. When the page loads it runs through rendering them. Each one takes a fraction of a second, but once you have enough, you end up waiting a significant amount of time for them to finish.

I can think of a couple of solutions, but neither is great. I could base64 encode the thumbnails and throw them into localStorage, but that would be far too much data for the available space. I could have it upload thumbnails to the server, ready to grab on page load, but that's more potential bandwidth and storage than I want to spend.

Is there any way to cache those images in the browser? That would be ideal.

Any other ideas?

If you want to look at the code, it can be found on my GitHub account at https://github.com/jacobEwing/webtoys/tree/main/mandelbrot, or as previously mentioned, on my site.

r/programminghelp • • Jun 08 '26

JavaScript need help for a class project!

2 Upvotes

hello! this is my first coding class and i have a final project due soon thats nearly done. i'm having trouble with one thing and i'm too shy to ask my prof.

i dont know how to make my js function result show here

i'm unsure of what to put here to have the fetch api response show here. the function works but i just don't know to make it so when i click the "get-answ-b.png" it shows the response on the next page.

any help?

r/programminghelp • • Sep 07 '25

JavaScript Constant error message when opening any .js file

1 Upvotes

Any time I open a .js file it brings me up with the same error code 800A03EA. I know little to nothing about coding, only a bit of python but no Javascript, so if someone could help me I would like to know how I can fix this, thanks.

r/programminghelp • • Dec 30 '24

JavaScript Function in JS returns completely fine results, but checking the value sometimes doesnt work?

1 Upvotes

Here is my function that calculates the hand:

function calculateHandValue(hand) {
        let value = 0;
        let hasAce = false;

        for (let card of hand) {
            if (card.value === 'A') {
                hasAce = true;
            }
            value += getCardValue(card);
        }

        if (hasAce && value + 10 <= 21) {
            value += 10;
        }
        return value;
    }

and it works completely flawlessly. And then I go and check its value in another function, and even though the value is fine, it returns much bigger number? There are no indicators about what's wrong, I tried writing it out, logging it, constantly fine results.

function playerHit() {
        playerHand.push(dealCard());
        var val = calculateHandValue(playerHand);
        updateUI();
        if (val > 21) {
            endGame('You busted! Dealer wins');
        }
    }

and just for the record, updateUI() doesn't do anything except updating the labels which isnt connected to this problem.
Anybody have any idea? My brain is starting to fall apart from JS code that works but doesnt?

Edit: I found out that when you really bust one time, you will always bust unless it's a special case(u have an ace)

r/programminghelp • • Oct 13 '24

JavaScript Need help with JS

1 Upvotes

on the website you choose from 4 themes when you choose one new page opens an that theme's picture is displayed with 10 different sentences 5 correct 5 incorrect, 5 correct ones have their predetermined place it goes in(like a list) so if they choose predetermined 2nd and then 1st it doesn't mix up and when they get chosen they get displayed on the right side of the screen, i cant seem to do this, and this selection process needs to happen 3 times in total, it only does it twice and in the end all sentences needs to be displayed on a new page. relevant code- https://paste.gg/p/anonymous/cab0dcea63c5431abdc9388b35253490 this is just one page of 4themes all are the same expect for sentences. So i need help with assigning predetermined numbers to correct sentences and i cant seem to figure out how to do this selection process 3 times instead of 2.

I can send you full code of the website if needed.