EmaSuriano / gatsby-starter-mate

An accessible and fast portfolio starter for Gatsby integrated with Contentful CMS
https://gatsby-starter-mate.netlify.app
BSD Zero Clause License
544 stars 162 forks source link

Error when running yarn setup #888

Closed SeaOfDreams closed 9 months ago

SeaOfDreams commented 1 year ago

I'm trying to install the new version of the theme (thanks @EmaSuriano for it).

All ok until I run "yarn setup", which runs the script "ts-node ./bin/setup"

Error from terminal: "Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\user\Documents\GitHub.....\node_modules\inquirer\lib\inquirer.js from C:\Users\user\Documents\GitHub......\bin\setup.ts not supported. Instead change the require of inquirer.js in C:\Users\user.....\GitHub.....\bin\setup.ts to a dynamic import() which is available in all CommonJS modules.

It seems that import is not supported, I changed it to a "require" statement but it's not working neither. I've tried on SOF and other resources but couldn't find a solution.

EmaSuriano commented 1 year ago

Hello @SeaOfDreams , the issue should be fixed with this PR :) https://github.com/EmaSuriano/gatsby-starter-mate/pull/893

SeaOfDreams commented 1 year ago

Hi @EmaSuriano, thanks for your fix. I noticed there was still an error when running the setup file. I had to de-structrure the objects in order to access the IDs, otherwise it was returning [object object] in the .env file. const {spaceId} = <any> await prompt(PROMPTS.spaceId); const {deliveryToken} = <any> await prompt(PROMPTS.deliveryToken); const {managementToken} = <any> await prompt(PROMPTS.managementToken);

Do you want me to open a pull request? Also, I can suggest some edit to the README in order to better specify some steps to connect to the Contentful space.

EmaSuriano commented 1 year ago

Oh I missed that, yes contribution will be much appreciated!

On Thu, 16 Mar 2023, 06:46 Filippo Livorno @.***> wrote:

Hi @EmaSuriano https://github.com/EmaSuriano, thanks for your fix. I noticed there was an error still when running the setup file. I had to de-structrure the objects in order to access the value, otherwise it was returning [object object] in the .env file. const {spaceId} = await prompt(PROMPTS.spaceId); const {deliveryToken} = await prompt(PROMPTS.deliveryToken); const {managementToken} = await prompt(PROMPTS.managementToken);

Do you want me to open a pull request? Also, I can suggest some edit to the README in order to better specify some steps to connect the Contentful space.

— Reply to this email directly, view it on GitHub https://github.com/EmaSuriano/gatsby-starter-mate/issues/888#issuecomment-1471623520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ56BMDG7M227W2RQUYPL3W4LOP3ANCNFSM6AAAAAAVJNH254 . You are receiving this because you were mentioned.Message ID: @.***>

EmaSuriano commented 9 months ago

PR merged :) Thanks!