Hi!!!, Great post I have been using the gh-pages-deploy.js script for a while and it worked perfectly, but for some reason now I get an error when usingrequire`.
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module...
...require() of ES modules is not supported...is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Hi, thanks.
Probably it's an error coming from upgrading packages. For instance, chalk and other libraries that gh-pages-deploy script uses, are now ESM only!
If you want me to help you, please drop me a message on Linkedin with a screenshot of the error you are getting.
Thanks for that. Yes setup-node@v1.1.0 is deprecated and setup-node@v2 should be used. I will make sure to update the article. Since you are using vue and you found the vue-cli plugin, then I guess you don't have to follow this article anymore. You can just install the plugin and everything that is in that article will automatically be done for you.
Thanks, yes I will take a look at the repo, when I have time, it is more updated and I see that there are more automations to get the user's name and email.
Hi!!!, Great post I have been using the
gh-pages-deploy.js script for a while and it worked perfectly, but for some reason now I get an error when using
require`.Error [ERR_REQUIRE_ESM]: Must use import to load ES Module...
...require() of ES modules is not supported...is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Is this happening to anyone?
Hi, thanks.
Probably it's an error coming from upgrading packages. For instance, chalk and other libraries that
gh-pages-deploy
script uses, are now ESM only!If you want me to help you, please drop me a message on Linkedin with a screenshot of the error you are getting.
Thanks Ronald!
Right, I was trying a lot of things for a while and finally found it by installing an older version of the packages.
Glad to see that you fixed it.
I was also getting some errors in the yml file.
I solved it by updating it following the structure of this file :
github.com/Rolanddoda/vue-cli-plug...
... and the name of my npm script also had a different name
I leave it here written down in case someone else finds it helpful.
Thanks for that. Yes
setup-node@v1.1.0
is deprecated andsetup-node@v2
should be used. I will make sure to update the article. Since you are using vue and you found the vue-cli plugin, then I guess you don't have to follow this article anymore. You can just install the plugin and everything that is in that article will automatically be done for you.Thanks, yes I will take a look at the repo, when I have time, it is more updated and I see that there are more automations to get the user's name and email.
Yup. :)