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

--no-typescript not quite 100% there #2781

Closed
isaacs opened this issue Apr 13, 2022 · 4 comments
Closed

--no-typescript not quite 100% there #2781

isaacs opened this issue Apr 13, 2022 · 4 comments

Comments

@isaacs
Copy link

isaacs commented Apr 13, 2022

What version of Remix are you using?

1.3.5

Steps to Reproduce

npx create-remix@latest --template blues-stack --no-typescript

Then try to npm run dev in the app it creates.

Expected Behavior

It should start the dev server.

Actual Behavior

Complains about a bunch of stuff:

  • server.ts is missing
  • prisma seed command fails because prisma/seed.ts is actually prisma/seed.js
  • many problems with trying to use import in commonjs contexts

Recommendation:

  • Ensure that all typescript references are converted in package.json when using the no-typescript option
  • Set "type": "module" in package.json and name all commonjs modules .cjs
    • alternative 1: name all esm modules .mjs
    • alternative 2: use "type":"module", leave everything .js, but add this bit at the top of any file that references require():
      import { createRequire } from 'node:module'
      const require = createRequire(import.meta.url)
      Maybe ideal? it's the way I prefer anyway, "Use The Platform" and all that.
@mryechkin
Copy link

Running into the same issue with the Indie Stack as well: Error: Cannot find module './seed.ts'

@JorgeMadson
Copy link

I got the same error, but I don't know where it comes from?
Is an error related to npm run setup? https://github.com/remix-run/blues-stack/blob/main/package.json#L21

@MichaelDeBoey
Copy link
Member

I've created remix-run/indie-stack#63, remix-run/blues-stack#57 & remix-run/grunge-stack#50 in order to fix this.

Closing this issue as it can be tracked in the stack repos itself now

@JorgeMadson
Copy link

Thank you @MichaelDeBoey I was trying to figure out how to fix this, I will read your code to understand it.

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

No branches or pull requests

4 participants