The Remix Stack for deploying to Fly with SQLite, authentication, testing, linting, formatting, etc.

Overview

Remix Indie Stack

The Remix Indie Stack

Learn more about Remix Stacks.

npx create-remix --template remix-run/indie-stack

What's in the stack

Not a fan of bits of the stack? Fork it, change it, and use npx create-remix --template your/repo! Make it your own.

Development

  • Initial setup: If you just generated this project, this step has been done for you.

    npm run setup
  • Start dev server:

    npm run dev

This starts your app in development mode, rebuilding assets on file changes.

The database seed script creates a new user with some data you can use to get started:

Relevant code:

This is a pretty simple note-taking app, but it's a good example of how you can build a full stack app with Prisma and Remix. The main functionality is creating users, logging in and out, and creating and deleting notes.

Deployment

This Remix Stack comes with two GitHub Actions that handle automatically deploying your app to production and staging environments.

Prior to your first deployment, you'll need to do a few things:

  • Install Fly

  • Sign up and log in to Fly

    fly auth signup

    Note: If you have more than one Fly account, ensure that you are signed into the same account in the Fly CLI as you are in the browser. In your terminal, run fly auth whoami and ensure the email matches the Fly account signed into the browser.

  • Create two apps on Fly, one for staging and one for production:

    fly create indie-stack-template
    fly create indie-stack-template-staging
    • Initialize Git.
    git init
  • Create a new GitHub Repository, and then add it as the remote for your project. Do not push your app yet!

    git remote add origin <ORIGIN_URL>
  • Add a FLY_API_TOKEN to your GitHub repo. To do this, go to your user settings on Fly and create a new token, then add it to your repo secrets with the name FLY_API_TOKEN.

  • Add a SESSION_SECRET to your fly app secrets, to do this you can run the following commands:

    fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app indie-stack-template
    fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app indie-stack-template-staging

    If you don't have openssl installed, you can also use 1password to generate a random secret, just replace $(openssl rand -hex 32) with the generated secret.

  • Create a persistent volume for the sqlite database for both your staging and production environments. Run the following:

    fly volumes create data --size 1 --app indie-stack-template
    fly volumes create data --size 1 --app indie-stack-template-staging

Now that everything is set up you can commit and push your changes to your repo. Every commit to your main branch will trigger a deployment to your production environment, and every commit to your dev branch will trigger a deployment to your staging environment.

Connecting to your database

The sqlite database lives at /data/sqlite.db in your deployed application. You can connect to the live database by running fly ssh console -C database-cli.

Getting Help with Deployment

If you run into any issues deploying to Fly, make sure you've followed all of the steps above and if you have, then post as many details about your deployment (including your app name) to the Fly support community. They're normally pretty responsive over there and hopefully can help resolve any of your deployment issues and questions.

GitHub Actions

We use GitHub Actions for continuous integration and deployment. Anything that gets into the main branch will be deployed to production after running tests/build/etc. Anything in the dev branch will be deployed to staging.

Testing

Cypress

We use Cypress for our End-to-End tests in this project. You'll find those in the cypress directory. As you make changes, add to an existing file or create a new file in the cypress/e2e directory to test your changes.

We use @testing-library/cypress for selecting elements on the page semantically.

To run these tests in development, run npm run test:e2e:dev which will start the dev server for the app as well as the Cypress client. Make sure the database is running in docker as described above.

We have a utility for testing authenticated features without having to go through the login flow:

cy.login();
// you are now logged in as a new user

We also have a utility to auto-delete the user at the end of your test. Just make sure to add this in each test file:

afterEach(() => {
  cy.cleanupUser();
});

That way, we can keep your local db clean and keep your tests isolated from one another.

Vitest

For lower level tests of utilities and individual components, we use vitest. We have DOM-specific assertion helpers via @testing-library/jest-dom.

Type Checking

This project uses TypeScript. It's recommended to get TypeScript set up for your editor to get a really great in-editor experience with type checking and auto-complete. To run type checking across the whole project, run npm run typecheck.

Linting

This project uses ESLint for linting. That is configured in .eslintrc.js.

Formatting

We use Prettier for auto-formatting in this project. It's recommended to install an editor plugin (like the VSCode Prettier plugin) to get auto-formatting on save. There's also a npm run format script you can run to format all files in the project.

Comments
  • NPM run dev failing

    NPM run dev failing

    I keep getting the following when I run 'NPM run dev' and I can't seem to figure out the problem. Do you have any suggestions? thank you so much

    dev:css npm run generate:css -- --watch

    dev:remix node --require ./mocks ./node_modules/.bin/remix dev

    🔶 Mock server running SyntaxError: missing ) after argument list

    opened by hamishakl 25
  • feat: remove all TypeScript references when `isTypeScript` is passed as `false` to `remix.init`

    feat: remove all TypeScript references when `isTypeScript` is passed as `false` to `remix.init`

    • [x] Update prisma seed script to use JS
    • [x] Cleanup include from jsconfig
    • [x] Replace vitest config with JS version
    • [x] Replace vitest-tsconfig-paths with js equivalent
    • [x] Updates cypress' cy.exec calls to use JS
    • [x] Replace mocks index with JS version

    https://github.com/remix-run/remix/pull/3150 needs to be merged first

    Closes #61

    opened by MichaelDeBoey 12
  • Cypress fails on CI (github action)

    Cypress fails on CI (github action)

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    Create a new project, deploy it with the github action, it will fails as it seems there's a bug with the latests NPM version.

    This is the error

    npm ERR! 'npm ci' can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with 'npm install' before continuing.

    FYI: I fix this issue changing the node version of the Cypress state to node-version: 16.10.0 (last v7 npm version) and it works.

    Expected Behavior

    Not fail in the cypress step on github action.

    Actual Behavior

    Cypress step of the build fails.

    needs response 
    opened by sergivillar 11
  • Run migrations on Fly io

    Run migrations on Fly io

    Just used this stack for the first time, was really awesome and made building my first Remix app a joy!!

    I modified my schema and ran the migration locally, and everything worked. When I pushed to main the GitHub action deployed my code to Fly.io but the migration didn’t run. I saw an error showing my app trying to query a table that didn’t exist.

    How can I run migrations on prod? And, is it possible to add this to my GitHub action?

    Thanks!

    opened by samselikoff 10
  • Add info about .env file in README

    Add info about .env file in README

    Hello 👋, Yesterday I tried to play with this template. I stuck a little with connection to SQLite, because I didn't know that app needs .env file. I am not sure if this information is placed somewhere, so I prepared this README update to save a few minutes of next colleagues ⏰

    Hope, you enjoy it✌️

    opened by Maciekek 9
  • fix: entry.client not using the new hydrateRoot

    fix: entry.client not using the new hydrateRoot

    i just saw that the indie-stack has react 18.0.0 but the entry.client was using old hydrate. Not sure if this was on purpose but on discord I was told to send a PR nonetheless.

    I looked at server.entry and thought of adding renderToReadableStream but I think this might have more implications than I understand about remix's choices.

    opened by cezarneaga 9
  • Unexpected end of file tsconfig.json

    Unexpected end of file tsconfig.json

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    Commands

    1. Run npx create-remix --template remix-run/indie-stack
    2. Choose Typescript
    3. Go to the folder
    4. Run npm run dev pr npm run build

    Setup

    OS: Windows 11 Node.js: 16.15.0 and 18.1.0 NPM: 8.9.0 Shell: 7.3.0-preview.3

    Expected Behavior

    Fully working Remix after setup.

    Actual Behavior

    For npm run build it fails in the step build:remix, remix build: image image

    For npm run dev it fails in Rebuilding phase. image

    opened by pegak 8
  • remix.init failed

    remix.init failed

    What version of Remix are you using?

    1.6.8

    Steps to Reproduce

    Hello - First time trying out Remix and the Getting Started tutorial is immediately failing for me.

    macOS Monteray node version 18.7.0 npm 8.15.0

    npx create-remix --template remix-run/indie-stack jake-start
    ? TypeScript or JavaScript? TypeScript
    ? Do you want me to run `npm install`? Yes
    

    This is a new machine and I assume you would be aware of a problem like this so may it will end up being a me thing, but everything else seems to be working on my end.

    Expected Behavior

    No CLI errors and "the app should be running," including a 200 at localhost:3000.

    Actual Behavior

    🚨 Oops, remix.init failed
    
    Cannot read properties of undefined (reading 'length')
    

    More:

    jake:~/repos/remix-getting-started$ npx create-remix --template remix-run/indie-stack jake-start
    ? TypeScript or JavaScript? TypeScript
    ? Do you want me to run `npm install`? Yes
    npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
    npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
    npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
    npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
    npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
    
    added 1312 packages, and audited 1313 packages in 55s
    
    231 packages are looking for funding
      run `npm fund` for details
    
    found 0 vulnerabilities
    đź’ż Running remix.init script
    🚨 Oops, remix.init failed
    
    Cannot read properties of undefined (reading 'length')
    

    There ends up being something which looks like an app in the folder, and npm run dev initially starts a server, but then loading a page results in:

    Error: error: Environment variable not found: DATABASE_URL.
      -->  schema.prisma:3
       |
     2 |   provider = "sqlite"
     3 |   url      = env("DATABASE_URL")
    
    bug 
    opened by djake 7
  • Error: Environment variable not found: DATABASE_URL.

    Error: Environment variable not found: DATABASE_URL.

    I'm getting the error after creating the project: Error: error: Environment variable not found: DATABASE_URL.

    OS: MacOS

    Steps to reproduce:

    1. Run npx create-remix --template remix-run/indie-stack test-proj
    2. Run npm run dev
    3. Open http://localhost:3000 in the browser

    Result: Remix App Server started at http://localhost:3000 (http://192.168.0.47:3000) Error: error: Environment variable not found: DATABASE_URL. --> schema.prisma:3 | | provider = "sqlite" | url = env("DATABASE_URL") |

    opened by pavlovtech 7
  • remix dev server issue

    remix dev server issue

    What version of Remix are you using?

    1.7.4

    Steps to Reproduce

    Use Linux (I use OpenSUSE Tumbleweed, kernel 5.19.13-1-default) Run npx create-remix@latest --template remix-run/indie-stack blog-tutorial Select TypeScript Try npm run dev

    Expected Behavior

    It should open the dev server.

    Actual Behavior

    It throws

    Error: listen EADDRNOTAVAIL: address not available 192.168.1.39:3000 at Server.setupListenHandle [as _listen2] (node:net:1468:21) at listenInCluster (node:net:1533:12) at GetAddrInfoReqWrap.doListen (node:net:1682:7) at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:113:8)

    error

    bug:unverified needs response 
    opened by LiberaTeMetuMortis 6
  • "Invariant failed" on npm start

    We're getting this error when on npm start after a migration command. I don't think there are more stack lines, though. Any idea if this is a misconfig or a bug of some kind?

    ```Preparing to run: sh start.sh as root fra [info]+ npx prisma migrate deploy Datasource "db": SQLite database "sqlite.db" at "file:/data/sqlite.db" No pending migrations to apply.

    • npm run start

    start remix-serve build /myapp/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:10 throw new Error(prefix); ^ Error: Invariant failed at invariant (/myapp/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:10:15) at Object. (/myapp/build/index.js:443:35) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18)

    opened by mrkurt 6
  • npx create-remix@latest bugs when selecting JavaScript

    npx create-remix@latest bugs when selecting JavaScript

    What version of Remix are you using?

    1.8.2

    Steps to Reproduce

    On an M1 Mac, MacOs 12.6.1. Running the create-remix@latest/indie stack, I get a bunch of errors when I select JavaScript (works if I choose Typescript)

    Using nvm, I tested on fresh installs of node v19.2.0, v18.12.1, and v16.18.1. Same errors on each.

    Looks like these might be ESM related. (Sorry, totally new to Remix)

    On the setup described above, as of Dec 7, 2022, running the following I get a bunch of errors. (See below)

    npx create-remix@latest --template remix-run/indie-stack test_remix
    

    Expected Behavior

    I would expect it to install without these errors.

    Actual Behavior

    ❯ node --version
    v19.2.0
    
    ~/Sites/test_remix
    ❯ npx create-remix@latest --template remix-run/indie-stack test_remix
    ? TypeScript or JavaScript? JavaScript
    ? Do you want me to run `npm install`? Yes
    ⠏ Creating your app…⠋ Migrating template to JavaScript…Processing 10 files...
    Spawning 9 workers...
    Sending 2 files to free worker...
    Sending 2 files to free worker...
    Sending 2 files to free worker...
    Sending 2 files to free worker...
    Sending 2 files to free worker...
    ⠼ Migrating template to JavaScript…node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)ode:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    m
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    ⠼ Creating your app…node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    ⠴ Migrating template to JavaScript…node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/@remix-run/dev/dist/cli/migrate/migrations/convert-to-javascript/transform'
    Require stack:
    - /Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
        at Module._load (node:internal/modules/cjs/loader:885:27)
        at Module.require (node:internal/modules/cjs/loader:1105:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at setup (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:91:18)
        at Object.<anonymous> (/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js:45:3)
        at Module._compile (node:internal/modules/cjs/loader:1218:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/ryanstout/.npm/_npx/5164864a48bff686/node_modules/jscodeshift/src/Worker.js'
      ]
    }
    
    Node.js v19.2.0
    All done.
    Results:
    0 errors
    0 unmodified
    0 skipped
    0 ok
    Time elapsed: 0.372seconds
    npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
    npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
    npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
    npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
    npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
    npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
    npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
    
    added 1403 packages, and audited 1404 packages in 12s
    
    257 packages are looking for funding
      run `npm fund` for details
    
    found 0 vulnerabilities
    đź’ż Running remix.init script
    
    > setup
    > prisma generate && prisma migrate deploy && prisma db seed
    
    Environment variables loaded from .env
    Prisma schema loaded from prisma/schema.prisma
    
    âś” Generated Prisma Client (4.7.1 | library) to ./node_modules/@prisma/client in 273ms
    You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
    

    import { PrismaClient } from '@prisma/client' const prisma = new PrismaClient()

    Environment variables loaded from .env
    Prisma schema loaded from prisma/schema.prisma
    Datasource "db": SQLite database "data.db" at "file:./data.db?connection_limit=1"
    
    SQLite database data.db created at file:./data.db?connection_limit=1
    
    1 migration found in prisma/migrations
    
    Applying migration `20220713162558_init`
    
    The following migration have been applied:
    
    migrations/
      └─ 20220713162558_init/
        └─ migration.sql
    
    All migrations have been successfully applied.
    Environment variables loaded from .env
    Running seed command `node --require tsconfig-paths/register prisma/seed.js` ...
    (node:26454) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
    (Use `node --trace-warnings ...` to show where the warning was created)
    /Users/ryanstout/Sites/test_remix/test_remix/prisma/seed.js:1
    import { PrismaClient } from "@prisma/client";
    ^^^^^^
    
    SyntaxError: Cannot use import statement outside a module
        at internalCompileFunction (node:internal/vm:74:18)
        at wrapSafe (node:internal/modules/cjs/loader:1141:20)
        at Module._compile (node:internal/modules/cjs/loader:1182:27)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
        at Module.load (node:internal/modules/cjs/loader:1081:32)
        at Module._load (node:internal/modules/cjs/loader:922:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
        at node:internal/main/run_main_module:23:47
    
    Node.js v19.2.0
    
    An error occurred while running the seed command:
    Error: Command failed with exit code 1: node --require tsconfig-paths/register prisma/seed.js
    🚨 Oops, remix.init failed
    
    Command failed: npm run setup
    
    bug:unverified 
    opened by ryanstout 1
  • JavaScript version fails when generating a seed for Prisma (on macOS 12.6 Intel)

    JavaScript version fails when generating a seed for Prisma (on macOS 12.6 Intel)

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    On macOS 12.6 Intel:

    1. npx create-remix@latest --template remix-run/indie-stack remix-experiment-2
    2. ? TypeScript or JavaScript? JavaScript
    3. ? Do you want me to runnpm install? Yes

    Expected Behavior

    The script completes successfully.

    Actual Behavior

    The remix.init script fails when generating a seed:

    Running seed command `node --require tsconfig-paths/register prisma/seed.js` ...
    TypeError: Cannot read properties of undefined (reading 'hash')
        at seed (/Users/ohodgson/inunison/repos/iu-remix-experiment/remix-experiment-2/prisma/seed.js:15:39)
    
    An error occured while running the seed command:
    Error: Command failed with exit code 1: node --require tsconfig-paths/register prisma/seed.js
    🚨 Oops, remix.init failed
    
    Command failed: npm run setup 
    

    Note: If I choose TypeScript at step 2 the script runs correctly.

    opened by OllyHodgson 4
  • Remix Monorepo 1.68 breaks Cypress in Indie Stack when importing from file

    Remix Monorepo 1.68 breaks Cypress in Indie Stack when importing from file

    Hi folks,

    thanks for Remix and the great community!

    I just updated Remix from 1.67 to 1.68 and one cypress tests fails now.


    What version of Remix are you using?

    1.68

    Steps to Reproduce

    1. Create a new indie stack project with npx create-remix --template remix-run/indie-stack
    2. Create a cypress test that uses an import in the form of either import { generateRandomInt } from "../../app/utils/helpers" or import { generateRandomInt } from "~/utils/helpers"
    3. See cypress break with:
    Webpack Compilation Error
    ./node_modules/@remix-run/react/dist/esm/components.js 730:45
    Module parse failed: Unexpected token (730:45)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
    |     id
    |   } = useRemixRouteContext();
    >   let resolvedPath = useResolvedPath(action ?? "."); // Previously we set the default action to ".". The problem with this is that
    |   // `useResolvedPath(".")` excludes search params and the hash of the resolved
    |   // URL. This is the intended behavior of when "." is specifically provided as
     @ ./node_modules/@remix-run/react/dist/esm/index.js 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232
     @ ./app/utils/helpers.ts
     @ ./cypress/e2e/todos.cy.ts
    GET /__cypress/tests?p=cypress/e2e/todos.cy.ts 200 2945.281 ms - -
    GET /__cypress/tests?p=cypress/support/e2e.ts 200 3673.227 ms - -
    GET /__/assets/FiraCode-VariableFont_wght.16865a4d.ttf 200 1.741 ms - -
    

    Expected Behavior

    I want the import to work.

    Solution

    • When I downgrade from monorepo version 1.68 to 1.67, it works again.
    • When I replace the import with inline code, it works again.

    Actual Behavior

    A webpack compilation error:

    Webpack Compilation Error
    ./node_modules/@remix-run/react/dist/esm/components.js 730:45
    Module parse failed: Unexpected token (730:45)
    You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
    |     id
    |   } = useRemixRouteContext();
    >   let resolvedPath = useResolvedPath(action ?? "."); // Previously we set the default action to ".". The problem with this is that
    |   // `useResolvedPath(".")` excludes search params and the hash of the resolved
    |   // URL. This is the intended behavior of when "." is specifically provided as
     @ ./node_modules/@remix-run/react/dist/esm/index.js 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232 13:0-232
     @ ./app/utils/helpers.ts
     @ ./cypress/e2e/todos.cy.ts
    GET /__cypress/tests?p=cypress/e2e/todos.cy.ts 200 2945.281 ms - -
    GET /__cypress/tests?p=cypress/support/e2e.ts 200 3673.227 ms - -
    GET /__/assets/FiraCode-VariableFont_wght.16865a4d.ttf 200 1.741 ms - -
    
    bug:unverified 
    opened by miku86 3
  • Unable to run latest IndieStack (JS) on Windows

    Unable to run latest IndieStack (JS) on Windows

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    Windows 10 Pro NPM: '8.5.4' Node: '16.16.0' JS/TS: JS

    npx create-remix --template remix-run/indie-stack Select 'JavaScript' cd npm run dev hit localhost:3000 app crashes (see errors in Actual Behavior)

    Expected Behavior

    App remains operational

    Actual Behavior

    App errors before loading: image Console: image

    opened by chelseachampions 1
  • @sendgrid/mail stopped by mock server development

    @sendgrid/mail stopped by mock server development

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    I'm not experienced enough to understand why, but running in local development stops the @sendgrid/mail api from working.

    1. Create a remix app using this stack.
    2. Install @sendgrid/mail from npm.
    3. Follow the instructions to setup an API key and verify sender.
    4. Use the example provided by SendGrid to send mail in an action on a route.
    5. The promise never resolves, the request stays in the (pending) state for ever.

    If you replace "dev:remix": "cross-env NODE_ENV=development binode --require ./mocks -- @remix-run/dev:remix dev", in package.json with "dev:remix": "cross-env NODE_ENV=development remix dev", it works as expected.

    Expected Behavior

    That the mock server would function as it does with other requests, log that the request was made with a message.

    Actual Behavior

    The mock server seems to block the requests by @sendgrid/mail.

    opened by asciant 2
The Remix Stack for deploying to Fly with Supabase, authentication, testing, linting, formatting, etc.

Remix Supa Fly Stack Learn more about Remix Stacks. npx create-remix --template rphlmr/supa-fly-stack What's in the stack Fly app deployment with Doc

Raphaël Moreau 157 Jan 7, 2023
The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.

Remix 677 Jan 2, 2023
The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.

Remix 311 Jan 1, 2023
Remix Stack for deploying to Vercel with remix-auth, Planetscale, Radix UI, TailwindCSS, formatting, linting etc. Written in Typescript.

Remix Synthwave Stack Learn more about Remix Stacks. npx create-remix --template ilangorajagopal/synthwave-stack What's in the stack Vercel deploymen

Ilango 56 Dec 25, 2022
The Remix Stack for Web2 apps and Web3 DApps with authentication with Magic, testing, linting, formatting, etc.

Remix French House Stack Learn more about Remix Stacks. npx create-remix --template janhesters/french-house-stack What's in the Stack? The French Hou

Jan Hesters 26 Dec 26, 2022
The Remix Stack for deploying to Vercel with testing, linting, formatting, structure and mock for 3rd party API integration.

Remix DnB Stack See it live: https://dnb-stack.vercel.app/ Learn more about Remix Stacks. npx create-remix --template robipop22/dnb-stack What's in th

Robert Pop 61 Dec 13, 2022
A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

Live Demo · Twitter A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Pris

Remix Stacks 18 Oct 31, 2022
An Open Source Remix template that integrates Stripe Subscriptions, Social Authentication, Testing and a few more features. SQLite version. Deploys to Fly.io

Live Demo · Twitter An Open Source Remix template that integrates Stripe Subscriptions, Social Authentication, Testing and a few more features. SQLite

xo 135 Dec 31, 2022
The Remix Stack with Clerk authentication, Supabase database, Chakra UI, testing, linting, and more.

Remix Bossa Nova Stack Learn more about Remix Stacks. What's in the stack User management with Clerk Database with Supabase Styling with Chakra UI Dep

Clerk 32 Jan 2, 2023
An Open Source Remix template that integrates Stripe Subscriptions, Social Authentication, Testing and a few more features. PostgreSQL version. Deploys to Fly.io

Live Demo · Twitter An open source Remix Stack that integrates Stripe Subscriptions, Social Authentication, Testing and a few more features. PostgreSQ

xo 25 Dec 7, 2022
A solid create-remix app, that applies best practices into a clean, batteries included template. SQLite version. Deploys to Fly.io

Remix Barebones Stack npx create-remix --template dev-xo/barebones-stack A solid create-remix app, that follows community guidelines and applies best

Dev XO 97 Dec 30, 2022
Visual Studio Code extension for formatting and linting Django/Jinja HTML templates using djLint

Visual Studio Code extension for formatting and linting Django/Jinja HTML templates using djLint

Almaz 25 Dec 15, 2022
A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

null 10 Apr 6, 2022
Fresh SQLite example on Fly.io.

fresh-sqlite-example Fresh example with SQLite and kysely query builder. See running example on Fly.io. Prerequisites Deno v1.23 or higher SQLite Opti

Michal Vavra 6 Nov 25, 2022
Tiny JavaScript library (1kB) by CurrencyRate.today, providing simple way and advanced number, money and currency formatting and removes all formatting/cruft and returns the raw float value.

Zero dependency tiny JavaScript library (1kB bytes) by CurrencyRate.today, providing simple way and advanced number, money and currency formatting and removes all formatting/cruft and returns the raw float value.

Yurii De 11 Nov 8, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Custom Remix stack using Clerk for authentication and full user management.

New Wave Stack Learn more about Remix Stacks. For more on our thoughts on the New Wave Stack check out our blog post. To view this template in deploym

Charles Wefso 11 Oct 11, 2022