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

Using template as specified does not seem to work #267

Open
kjprice opened this issue Jun 16, 2023 · 4 comments
Open

Using template as specified does not seem to work #267

kjprice opened this issue Jun 16, 2023 · 4 comments

Comments

@kjprice
Copy link

kjprice commented Jun 16, 2023

tl;dr can we please update the readme to have template instructions that will work for an impatient noob?

Hello!

I'm new to remix and love it!

The examples are great but I had a tough time using one of the examples as a template.

Problem

In the readme I followed the instructions:

You can also initialize a new project with any of these examples using the --template flag of the create-remix CLI.

And used the example npx create-remix@latest --template examples/<example-dir>

Running this on my own, to use the socket.io example, I ran the following command:

npx create-remix@latest --template examples/socket.io

However, I received the following error:

🚨 Invalid template selected. Please try again.

Solution

After reviewing the docs related to templates I experimented with a few possibilities.

These did not work for me:

npx create-remix@latest --template examples/main/socket.io
npx create-remix@latest --template remix-run/examples/blob/main/socket.io
npx create-remix@latest --template remix-run/examples/socket.io

Finally, using the full github path, this did work for me:

npx create-remix@latest --template https://github.com/remix-run/examples/tree/main/socket.io

My solution I believe is overly verbose than necessary, but if we can update the readme to have an example that will definitely run that would be great.

Thanks again for an amazing product!

@MichaelDeBoey
Copy link
Member

I guess this is because of the . in the folder name as doing npx create-remix@latest --template examples/tailwindcss just works as expected

@lasas
Copy link

lasas commented Nov 22, 2023

I guess this is because of the . in the folder name as doing npx create-remix@latest --template examples/tailwindcss just works as expected

Well, I tried it and it doesn't work for me, errors with: Oh no! There was a problem fetching the file from GitHub. The request responded with a 404 status. Please try again later.

But workaround using full repository name worked: npx create-remix@latest --template https://github.com/remix-run/examples/tree/main/tailwindcss.

@SivertGullbergHansen
Copy link

Well, I tried it and it doesn't work for me, errors with: Oh no! There was a problem fetching the file from GitHub. The request responded with a 404 status. Please try again later.

But workaround using full repository name worked: npx create-remix@latest --template https://github.com/remix-run/examples/tree/main/tailwindcss.

I experience the same thing. Seems it has not been fixed yet.

@maxrchung
Copy link
Contributor

maxrchung commented Mar 4, 2024

Well, I tried it and it doesn't work for me, errors with: Oh no! There was a problem fetching the file from GitHub. The request responded with a 404 status. Please try again later.

For this error, try adding remix-run/ to the front of the template parameter. The docs use a remix-run/examples/<example-dir> format but the README uses a examples/<example-dir> format. I opened a PR to update the README: #435

Edit: As for the original socket.io issue, I did a quick test and adding remix-run/ seems to work, but examples/socket.io still shows the same issue.

PS C:\Users\Max\Desktop> npx create-remix@latest --template remix-run/examples/socket.io

 remix   v2.8.0 💿 Let's build a better website...

   dir   Where should we create your new project?
         ./my-remix-app

      ◼  Template: Using remix-run/examples/socket.io...
      ✔  Template copied

   git   Initialize a new git repository?
         No

  deps   Install dependencies with npm?
         No
      ◼  Skipping install step. Remember to install dependencies after setup with npm install.

  done   That's it!

         Enter your project directory using cd .\my-remix-app
         Check out README.md for development and deploy instructions.

         Join the community at https://rmx.as/discord
PS C:\Users\Max\Desktop> npx create-remix@latest --template examples/socket.io

 remix   v2.8.0 💿 Let's build a better website...

   dir   Where should we create your new project?
         ./my-remix-app

      ◼  Template: Using examples/socket.io...

      ▲  Oh no! "examples/socket.io" is an invalid template. Run create-remix --help to see supported template formats.

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

Successfully merging a pull request may close this issue.

5 participants