Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] Merino Stack TypeError after creating project, empty folder #95

Open
angelhdzmultimedia opened this issue Jan 21, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@angelhdzmultimedia
Copy link

Environment


  • Operating System: Windows_NT
  • Node Version: v18.1.0
  • Nuxt Version: 0.0.0
  • Nitro Version: -
  • Package Manager: unknown
  • Builder: webpack
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

No repro. Problem with CLI.

Describe the bug

Fresh project with pnpm create sidebase@latest or npm create sidebase@latest.

Merino
nuxt-auth
No GIT init
Yes install

Error:

Failed to initialize project folder - does a folder with the same name already exist? Aborting mission. Here is the full error:
TypeError

And there are no other folders in the root. Reloaded VSCode workspace. Tried many times with different names.

Ultimately, selected Cheviot Stack and it was successful.

Additional context

No response

Logs

No response

@angelhdzmultimedia angelhdzmultimedia added the bug Something isn't working label Jan 21, 2023
@BracketJohn
Copy link
Contributor

Hey @angelhdzmultimedia 👋

This happend, when a folder with the same name already exists (see error message). You can / should just choose a different name for your project in the first step!

There's th eoption to re-ask the user in this case for a new name.

Let's convert this into a feature request for that (:

@BracketJohn BracketJohn added enhancement New feature or request and removed bug Something isn't working labels Jan 31, 2023
@angelhdzmultimedia
Copy link
Author

Hey @angelhdzmultimedia 👋

This happend, when a folder with the same name already exists (see error message). You can / should just choose a different name for your project in the first step!

There's th eoption to re-ask the user in this case for a new name.

Let's convert this into a feature request for that (:

Thanks so much for replying!

But I mentioned this:

image

I can clearly see what the error message say, but it's a fresh folder, no other folders have been made, even after reloading VSCode.

I did many tests until I figured out this was a bug.

@oripka
Copy link

oripka commented Feb 3, 2023

Same thing on macOS. I tried different folder names that did not exist. It is a bug.

yarn create sidebase
yarn create v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Installed "create-sidebase@0.3.2" with binaries:
      - create-sidebase
[###########################################################################################################################################################] 199/199
        __  _
    .-.'  `; `-._  __  _
   (_,         .-:'  `; `-._
 ,'o"(        (_,           )
(__,-'      ,'o"(            )>
   (       (__,-'            )
    `-'._.--._(             )
       |||  |||`-'._.--._.-'
                  |||  |||
🐑 Diamond:
Welcome to sidebase v0.3.2!

🐑 Diamond:
sidebase helps you to create fully typesafe Nuxt 3 app in seconds: https://sidebase.io/sidebase 

🐑 Diamond:
Let's get started:
✔ What will your project be called? … yyy
✔ What stack would you like to use for your new project? More information: https://sidebase.io/sidebase/welcome/stacks › Merino
✔ Which modules would you like to use? › Prisma ORM, nuxt-auth, tRPC 10, Tailwind CSS
✔ Initialize a new git repository? … yes
✔ Initialize a default CI pipeline? › No CI
✔ Would you like to run `yarn install` after finishing up? … yes

🐑 Diamond:
Now setting up yyy:
⠋ Adding Nuxt 3 merino-template(node:70641) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
⠙ Adding Nuxt 3 merino-template
🐑 Diamond:
Failed to initialize project folder - does a folder with the same name already exist? Aborting mission. Here is the full error: 
TypeError: fetch failed
✨  Done in 20.81s.

@BracketJohn
Copy link
Contributor

Hey you two 👋

I'll look into it - thanks for elaborating!

@BracketJohn
Copy link
Contributor

So, from checking out the code, I think that the await downloadTemplate call is failing for you. This is a method that we import from https://github.com/unjs/giget.

For later documentation, Here's some minimal code that should be able to reproduce what you are experiencing:

import { downloadTemplate } from "giget"

const template = await downloadTemplate('github:sidebase/merino#v3', {
    dir: 'yyy',
    registry: "https://raw.githubusercontent.com/nuxt/starter/templates/templates"
})

The error occurs within the fetch of giget, which is called here:

https://github.com/unjs/giget/blob/21a1f0bd0a659ec6ef3ac67255844f83027ddca7/src/_utils.ts#L53-L57

I've opened and merged sidebase/create-sidebase#12 to expand the error logging that will happen when the command fails. Can you please:

  1. ensure that you're using the just-releaded create-sidebase@0.3.3
  2. reproduce the error and show me the output?

This will enable me to see whether the error is with us or with giget. Thanks!

@oripka
Copy link

oripka commented Feb 4, 2023

Thanks for the progress on this, here is the output of version 0.3.3

yarn create sidebase
yarn create v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...

success Installed "create-sidebase@0.3.3" with binaries:
      - create-sidebase
[############################################################################################################################] 199/199
        __  _
    .-.'  `; `-._  __  _
   (_,         .-:'  `; `-._
 ,'o"(        (_,           )
(__,-'      ,'o"(            )>
   (       (__,-'            )
    `-'._.--._(             )
       |||  |||`-'._.--._.-'
                  |||  |||
🐑 Diamond:
Welcome to sidebase v0.3.3!

🐑 Diamond:
sidebase helps you to create fully typesafe Nuxt 3 app in seconds: https://sidebase.io/sidebase 

🐑 Diamond:
Let's get started:
✔ What will your project be called? … test
✔ What stack would you like to use for your new project? More information: https://sidebase.io/sidebase/welcome/stacks › Merino
✔ Which modules would you like to use? › Prisma ORM, nuxt-auth, tRPC 10, Tailwind CSS
✔ Initialize a new git repository? … yes
✔ Initialize a default CI pipeline? › No CI
✔ Would you like to run `yarn install` after finishing up? … yes

🐑 Diamond:
Now setting up test:
⠙ Adding Nuxt 3 merino-template
🐑 Diamond:
Failed to initialize project folder - does a folder with the same name already exist? Aborting mission. Here is the full error:
TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:12789:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async sendFetch (file:///Users/otr/.config/yarn/global/node_modules/giget/dist/shared/giget.5e7ec864.mjs:47:10)
    at async download (file:///Users/otr/.config/yarn/global/node_modules/giget/dist/shared/giget.5e7ec864.mjs:22:20)
    at async downloadTemplate (file:///Users/otr/.config/yarn/global/node_modules/giget/dist/shared/giget.5e7ec864.mjs:179:5)
    at async downloadTemplate_default (file:///Users/otr/.config/yarn/global/node_modules/create-sidebase/dist/chunk-HXHFCPB3.js:26:16)
    at async wrapInSpinner (file:///Users/otr/.config/yarn/global/node_modules/create-sidebase/dist/chunk-LVB3MHNO.js:11:18)
    at async main (file:///Users/otr/.config/yarn/global/node_modules/create-sidebase/dist/index.js:72:20) {
  cause: Error: self signed certificate
      at TLSSocket.onConnectSecure (node:_tls_wrap:1540:34)
      at TLSSocket.emit (node:events:512:28)
      at TLSSocket._finishInit (node:_tls_wrap:959:8)
      at ssl.onhandshakedone (node:_tls_wrap:743:12) {
    code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
  }
}
✨  Done in 12.99s.

@oripka
Copy link

oripka commented Feb 4, 2023

I also tried a workaround by setting NODE_TLS_REJECT_UNAUTHORIZED

Now I get another error:

% export NODE_TLS_REJECT_UNAUTHORIZED=0    
% yarn create sidebase                     
yarn create v1.22.19
[1/4] 🔍  Resolving packages...
⠁ (node:43563) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Installed "create-sidebase@0.3.3" with binaries:
      - create-sidebase
[############################################################################################################################] 199/199(node:43566) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)

        __  _
    .-.'  `; `-._  __  _
   (_,         .-:'  `; `-._
 ,'o"(        (_,           )
(__,-'      ,'o"(            )>
   (       (__,-'            )
    `-'._.--._(             )
       |||  |||`-'._.--._.-'
                  |||  |||
🐑 Diamond:
Welcome to sidebase v0.3.3!

🐑 Diamond:
sidebase helps you to create fully typesafe Nuxt 3 app in seconds: https://sidebase.io/sidebase 

🐑 Diamond:
Let's get started:
✔ What will your project be called? … test2
✔ What stack would you like to use for your new project? More information: https://sidebase.io/sidebase/welcome/stacks › Merino
✔ Which modules would you like to use? › Prisma ORM, nuxt-auth, tRPC 10, Tailwind CSS
✔ Initialize a new git repository? … yes
✔ Initialize a default CI pipeline? › No CI
✔ Would you like to run `yarn install` after finishing up? … yes

🐑 Diamond:
Now setting up test2:
⠸ Adding Nuxt 3 merino-template
🐑 Diamond:
Failed to initialize project folder - does a folder with the same name already exist? Aborting mission. Here is the full error:
Error: TAR_BAD_ARCHIVE: Unrecognized archive format
    at Unpack.warn (/Users/otr/.config/yarn/global/node_modules/tar/lib/warn-mixin.js:21:40)
    at Unpack.warn (/Users/otr/.config/yarn/global/node_modules/tar/lib/unpack.js:229:18)
    at Unpack.<anonymous> (/Users/otr/.config/yarn/global/node_modules/tar/lib/parse.js:83:14)
    at Unpack.emit (node:events:524:35)
    at [emit] (/Users/otr/.config/yarn/global/node_modules/tar/lib/parse.js:303:12)
    at [maybeEnd] (/Users/otr/.config/yarn/global/node_modules/tar/lib/parse.js:426:17)
    at [consumeChunk] (/Users/otr/.config/yarn/global/node_modules/tar/lib/parse.js:458:21)
    at Unpack.write (/Users/otr/.config/yarn/global/node_modules/tar/lib/parse.js:385:25)
    at Unpack.end (/Users/otr/.config/yarn/global/node_modules/tar/lib/parse.js:505:14)
    at Pipe.end (/Users/otr/.config/yarn/global/node_modules/minipass/index.js:75:17) {
  recoverable: false,
  file: '/Users/otr/.giget/sidebase-merino/v3.tar.gz',
  cwd: '/Users/otr/code/tmp/test2',
  code: 'TAR_BAD_ARCHIVE',
  tarCode: 'TAR_BAD_ARCHIVE'
}
✨  Done in 10.29s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants