indie-stack
indie-stack copied to clipboard
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:
npx create-remix@latest --template remix-run/indie-stack remix-experiment-2? TypeScript or JavaScript? JavaScript? 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.
I'm running into excactly the same issue, hence I'm using mac os 12.6 with M1.
Solved it by changing seed.js
const { PrismaClient } = require("@prisma/client");
- const bcrypt = require("bcryptjs").default;
+ const bcrypt = require("bcryptjs");
const prisma = new PrismaClient();
the same issue, when i do npm run dev . i get in my browser
TypeError: invariant is not a function
at app/session.server.js (C:\Users\A\Desktop\myReact\blog-tutorial\app\session.server.js:7:1)
at C:\Users\A\Desktop\myReact\blog-tutorial\build\index.js:6:56
at Object.
I just ran into this on an m1, macOS 12.6 (21G115), nodejs 19.0.0, but ONLY when selecting Javascript at the first prompt. If I select typescript, it installs 👍
All migrations have been successfully applied.
Environment variables loaded from .env
Running seed command `node --require tsconfig-paths/register prisma/seed.js` ...
TypeError: Cannot read properties of undefined (reading 'hash')
at seed (/Users/ericbrookfield/test/blog-tutorial/prisma/seed.js:14:39)
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
@MichaelDeBoey seems to be the same as https://github.com/remix-run/remix/issues/4467 👀
Faced with te same error today when trying to do
npx create-remix@latest --template remix-run/indie-stack blog-tutorial
? TypeScript or JavaScript? JavaScript
? Do you want me to run `npm install`? Yes
⠙ Migrating template to JavaScript…Processing 10 files...
got this error
Running seed command `node --require tsconfig-paths/register prisma/seed.js` ...
TypeError: Cannot read properties of undefined (reading 'hash')
at seed (/home/dmitry/Downloads/blog-tutorial/prisma/seed.js:14:39)
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
Fixed by remix-run/remix#5163.
For more detail on the approach taken, see the decision doc for JS conversion support