ENOENT problem only on netlify

Hello,

I get this when I try to access to my netlify function :

Error - spawn /var/task/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT

The problem append only on netlify, everything works like a charm in local when lunch “netlify dev”. No problem during the build process.

You can access to the website here : https://pdf-generation-easy-societe.netlify.app/api/creation/test

If you need access to my repo, give me a gitlab email account please.

Regards,

As I’ve mentioned in your other thread, your setup confuses me. Feel free to invite me to your repo:

It’s done.
I stay here if you have any question.

I get this error:

{"message":"Can not find this type of company","data":{"sctType":"/.netlify/functions/creation"},"isError":true}

I’ve set the environment variables mentioned in the readme:

ES_ENV=dev
LOG_LEVEL=1

what am I missing?

You have to hit the endpoint https://pdf-generation-easy-societe.netlify.app/api/creation/test
You just miss the route params

Sorry for the delay, but I’m unable to see the issue that you mention. As I mentioned, I cloned the repo, installed the Node Modules, set the .env file and ran netlify dev in terminal. Whenever I go to:

http://localhost:8888/api/creation/test

I get the error:

SyntaxError - Cannot use import statement outside a module

While this can possibly be fixed, your codebase seems to be all over the place and offering such code-level debugging is unfortunately out of our scope. If you know how to get past this issue to see the actual problem you’re seeing.

I think you pull the repo few days ago. And forget to git pull the last version of my code yesterday.
Can you retry please ?
If it doesn’t work on the main, please
git checkout feat-document && git pull
But it should also work on main branch now

So, aside from what Hrishikesh was working with you on, I notice that phantomjs was end-of-lifed quite a while ago (years, not months). Might I suggest using something more modern, as referred to in this article? node.js - Which one of the headless browse do i choose? - Stack Overflow

I think folks have used puppeteer with more success in recent days.

1 Like

Ok I understand. Thank you very much. It’s a dependency of a dependency. I will just choose another one.

1 Like