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

npx create-remix@latest bugs when selecting JavaScript #182

Closed
ryanstout opened this issue Dec 8, 2022 · 3 comments
Closed

npx create-remix@latest bugs when selecting JavaScript #182

ryanstout opened this issue Dec 8, 2022 · 3 comments

Comments

@ryanstout
Copy link

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
@ryanstout ryanstout changed the title Setup with JavaScript issue npx create-remix@latest bugs when selecting JavaScript Dec 8, 2022
@machour machour transferred this issue from remix-run/remix Dec 13, 2022
@polydevuk
Copy link

Just hit the same bug as a newcomer to Remix, opting for Javascript. Doesn't exactly inspire confidence given the lack of response to the issue.

@pcattori
Copy link

Fixed by remix-run/remix#4891, which was released in v1.9.0 on Dec 16 2022.

Additional improvements to the TS->JS conversion were made in remix-run/remix#5163 along with a write up of the approach in the form of a decision doc: https://github.com/remix-run/remix/blob/dev/decisions/0008-only-support-js-conversion-for-app-code.md

@aniketicloud
Copy link

aniketicloud commented Jul 22, 2023

I am getting the same issue on new laptop on Windows 11.
I have Node LTS 18 and NPM too.
Some issue with npx I think. Because it even npx jest is not working

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