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

prisma/seed.js generated with invalid module access #175

Closed
stefanpenner opened this issue Nov 13, 2022 · 2 comments
Closed

prisma/seed.js generated with invalid module access #175

stefanpenner opened this issue Nov 13, 2022 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@stefanpenner
Copy link

stefanpenner commented Nov 13, 2022

What version of Remix are you using?

1.7.5

Steps to Reproduce

  1. npx @remix-run/dev create project-name
? What type of app do you want to create? A pre-configured stack ready for production
? Which Stack do you want? (Learn more about these stacks: 'https://remix.run/stacks') Indie
? TypeScript or JavaScript? JavaScript
? Do you want me to run `npm install`? Yes

then fix package.json "prisma": { "seed": "node prisma/seed.js" } by dropping --require tsconfig-paths/register as this is a JavaScript not a TS project

Expected Behavior

it should work

Actual Behavior

TypeError: Cannot read properties of undefined (reading 'hash')
    at seed (/Users/stefanpenner/src/stefanpenner/lcc-live/prisma/seed.js:14:39)

the generated module code is:

const bcrypt = require("bcryptjs").default;
...
const hashedPassword = await bcrypt.hash("racheliscool", 10);
...

but the .default appears incorrect, as it is undefined, the following change makes it work

const bcrypt = require("bcryptjs")
@machour machour transferred this issue from remix-run/remix Nov 13, 2022
@machour
Copy link
Collaborator

machour commented Nov 13, 2022

Duplicate of #164

@machour machour marked this as a duplicate of #164 Nov 13, 2022
@machour machour closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2022
@stefanpenner
Copy link
Author

@machour yup it is, thanks.

@MichaelDeBoey MichaelDeBoey added duplicate This issue or pull request already exists and removed bug:unverified labels Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants