Error Code 500 on dynamic pages

Question:
How do I get rid of the error 500 on dynamic pages when I publish the site. Site has been working great until I tried to install pdf generator.

Product:
Wix Editor

What are you trying to achieve:
Originally, I was trying to install pdf generator. Everything worked great in Preview, but when I published it, now all dynamic pages give me an error 500. I roll back to prior version and it works, but I cannot install any npm packages now.

What have you already tried:
Rolled back, re-installed, published. Something seems to be permanently damaged. At this point, I have removed all npm and code packages. I get the same error message regardless of the npm I try to load, eg. Moment.

Additional information:
I installed the two npm packages the requested, pdf-generator-api-client (v4.01) and jsonwebtoken.js. Put in the secret codes. Uploaded there sample code as a code package. As i said, everything worked great in Preview, but Publish version does not work. Here is a page that is failing https://www.srcahome.com/for-sale-or-rent-list

Can you share the code that isn’t working?

Also while we allow users to install npm packages we don’t provide direct support for them. For issues with any given npm package you should contact the package maintainer.

There is no specific code that is failing. When I install ANY npm package, the next time I publish the site, I get error code 500 on every dynamic page.

I am not importing anything from the npm into the code. nor am I making any changes to existing code after the npm is installed.

The existence of the npm package is triggering something.

This all started when I was attempting to install pdf generator. (pdf-generator-api-client). Everything worked great in PRVIEW, but when I published the site, that’s when the error 500 started. I have no problems in PREVIEW

I rolled back to a prior version of the site without any npm packages installed and everything works fine. I pick any npm package at the error appears.

I can’t reproduce npm causing the crash but do see a few people reporting 500 errors with Dynamic Pages. Will share internally but also best place to report this is: Contact Wix

Can you share an example link to a site with this issue? Or have you contacted support and do you have a ticket?

Is there any update on this? I am having the same issue on my dynamic pages where they get the 500 Error a good amount of the time. Seems to randomly come and go and cannot reliably reproduce it. I also have NPM packages installed, but I will try uninstalling. My backend logs indicate no errors.

UPDATE: Uninstalling NPM didn’t do anything. However, I just converted my dynamic page into a static page and loaded the data using Javascript. Easy enough and way more reliable than letting Wix handle passing around the data.

My problem was that if I added an npm to my site, I would get Error code 500. The error would appear on any dynamic page even though no changes were made to that page. It seemed to happen with any npm added. There was no identified pattern, nor were there any error messages generated. I don’t know that this will solve your issue, but it did mine, and that was when I got the 500 code error, I did the following:

  1. Closed my browser, (Microsoft Edge)
  2. Opened the browser and deleted all history, especially cached images and files.
  3. Closed the browser.
  4. Opened task manager and ended the browser task if it was running. This would eliminate all remnants of the site from my browser.

After that, the error code 500 was gone. Occasionally, the 500 error code will reappear if I am making design changes to the site that involve dynamic pages or calls to npm code, but if I repeat the above process, all is good.

Not very technical, but it works for me.