NodeJS help

Hey guys,

I’m testing NodeJS and started a project… I NEED HELP!! :stuck_out_tongue_winking_eye:
(wappler 6.1.2 stable)

I’m working localy with SQLite and everything was normal to me until one point…

I had created an API called rndr_A which I call from my layout page.
All OK…

I duplicated the serveraction and the newly (duplicate) gives me a 404 error…
image

How is that possible?

(In php that was clear… When duplicating an API action it was working perfectly as long as the name was unique and valid)

Do I have to do something else except just duplicate the api action in order for this to work?

Thanks in advance

Huh, that’s a symptom of NodeJS not restarting automatically on file changes, weird. If you restart should work, right?

1 Like

WTF!!! :face_with_symbols_over_mouth:
All day yesterday was a ‘broken’ day because of that.

That was it…
I closed wappler and also quit from the tray icon. When I opened again both serverconnects run as they should…

Maybe it is not a good practice to duplicate pages or apis in NodeJS?
As a matter of fact, I have watched every video from @ben and @Hyperbytes and that was a question that I had… “Why they don’t just duplicate that api or page and do a few changes?”

Instead of close and quit wappler, maybe just restarting local server is better?
image
I’m gonna do this all the time…

What do you suggest?

How has the project been setup - Wappler Local or Docker?

That’s my first go-to when things do not work. :+1:

1 Like

LOCAL!!! I don’t know of Mr Docker… :upside_down_face:

I quess NodeJS is kind of sensitive… :wilted_flower:
And since my thread excuses more questions, can I ask if there is a way to duplicate a page (layout or content?
I quess it it the definition and relation of layout and content that makes that difficult?
Anyway, I can live with that… Create a new page and just copy/paste the code…
Thanks brother

Please open a bug report, the lack of automatic restart is a bug

Probably it isn’t monitoring new files, but rather existing files.

By the way, for curiosity, the technical term for this feature is file watch

2 Likes

Hi Tasos, I usually go into the Files panel, duplicate the document and rename it.

1 Like

I suppose everybody working with NodeJS knows that behavior and they can handle it…
Open a Bug report and how to explain how to reproduce it?

That was what I was facing…

:+1: Thanks brother!

Thanks Ben, but this way we loose the rooting functionality that is automatically handled from wappler…
Right?

*By the way, talking about files->Duplicate page…
Where is the config.js file located? (in PHP-> dmxAppConnect/config.js)
I’m asking because when I wanted to dublicate a page in PHP (with a different/new APP ID), I was first creating a new node in config.js with the new App ID that I was going to use in the new page and then change the App ID of the duplicated page…
Otherwise the old content of the config.js node was overwritten by the new (and that meant it was an empty node until I add a new compnent, tablerepeat, datastore etc)

I have seen this issue several times in the past, I thought it was random but maybe you have localised the issue,if so, that’s great.
To be honest, any strange behaviour In Wappler my number one action is to restart wappler. Fixes most usual glitches.

2 Likes