r/programminghelp • • 17d 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 • • 29d ago

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 • • 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 • • 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 • • 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 • • Jan 15 '26

JavaScript create a unique chat instance for a unique javascript game instance

2 Upvotes

I am developing a game that requires chat feature, Everyone who starts the game is asked to enter a password for the game, once he does, he gets a shareable link which he can share to the team. Once people have this shareable link, they can join the unique game instance. Each game instance can have 100-200 users and multiple game instances can be spawned.

I need to create a chat for each unique instance of the game created, the chat can be temporary with no persistent history maintained but members of the same game session are able to access it and just as long as the game session is active the chat should persist.

Anyone who joins the unique game instance should be able to access the chat. What's the best, quickest and cheapest way to implement this feature.

I'm open to third party library or services, or using any existing services available, but, it has to have the feature to have this unique session that only the unique game instance members can access.