reflex-dev / reflex

🕸️ Web apps in pure Python 🐍
https://reflex.dev
Apache License 2.0
19.25k stars 1.09k forks source link

Cannot find module 'next/dist/compiled/arg/index.js' #2396

Open chrisgeli opened 8 months ago

chrisgeli commented 8 months ago

Describe the bug After reflex init of a blank app, I tried running it with reflex run and it stopped with Error: Cannot find module 'next/dist/compiled/arg/index.js'.

To Reproduce Steps to reproduce the behavior:

Expected behavior Expecting to see the app.

Screenshots N/A, browser didn't open. Here is the reflex run --loglevel debug output:

(.venv) cgelinek@gar:/projects/my_project/interactive$ reflex run --loglevel debug
─────────────────────────────────────────────────────────────────────────────── System Info ───────────────────────────────────────────────────────────────────────────────
Debug: Config file: '/projects/my_project/interactive/.venv/lib/python3.11/site-packages/reflex/config.py'
Debug: Config: app_name='interactive' loglevel=<LogLevel.INFO: 'info'> frontend_port=3000 frontend_path='' backend_port=8000 api_url='http://localhost:8000' 
deploy_url='http://localhost:3000' backend_host='0.0.0.0' db_url='sqlite:///reflex.db' redis_url=None telemetry_enabled=True 
bun_path='/home/cgelinek/.local/share/reflex/bun/bin/bun' cors_allowed_origins=['*'] tailwind={} timeout=120 next_compression=True event_namespace=None 
frontend_packages=[] cp_backend_url='https://rxcp-prod-control-plane.fly.dev' cp_web_url='https://control-plane.reflex.run' 
gunicorn_worker_class='uvicorn.workers.UvicornH11Worker'
Debug: Running command: ['/home/cgelinek/.local/share/reflex/fnm/node-versions/v18.17.0/installation/bin/node', '-v']
Debug: Running command: ['/home/cgelinek/.local/share/reflex/fnm/fnm', '--version']
Debug: Running command: ['/home/cgelinek/.local/share/reflex/bun/bin/bun', '-v']
Debug: [Reflex 0.3.8 with Python 3.11.2 (PATH: /projects/my_project/interactive/.venv/bin/python3)]
Debug: [Node 18.17.0 (Expected: 18.17.0) (PATH:/home/cgelinek/.local/share/reflex/fnm/node-versions/v18.17.0/installation/bin/node)]
Debug: [FNM 1.35.1 (Expected: 1.35.1) (PATH: /home/cgelinek/.local/share/reflex/fnm/fnm)]
Debug: [Bun 1.0.13 (Expected: 1.0.13) (PATH: /home/cgelinek/.local/share/reflex/bun/bin/bun)]
Debug: [OS Linux Debian GNU/Linux 12 (bookworm)]
Debug: Using package installer at: /home/cgelinek/.local/share/reflex/bun/bin/bun
Debug: Using package executer at: /home/cgelinek/.local/share/reflex/fnm/node-versions/v18.17.0/installation/lib/node_modules/npm/bin/npm-cli.js
Debug: Unzip path: /usr/bin/unzip
─────────────────────────────────────────────────────────────────────────── Starting Reflex App ───────────────────────────────────────────────────────────────────────────
Compiling: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 9/9 0:00:00
Debug: Running command: ['/home/cgelinek/.local/share/reflex/bun/bin/bun', 'install', '--loglevel', 'silly']
Debug: Installing base frontend packages
Debug: bun add v1.0.13 (f5bf67bd)
Debug:  Saved lockfile
Debug:  + autoprefixer@10.4.14 (v10.4.16 available)
Debug:  + postcss@8.4.31 (v8.4.33 available)
Debug:  + @emotion/react@11.11.1 (v11.11.3 available)
Debug:  + axios@1.4.0 (v1.6.5 available)
Debug:  + json5@2.2.3
Debug:  + next@14.0.1 (v14.0.4 available)
Debug:  + next-sitemap@4.1.8 (v4.2.3 available)
Debug:  + next-themes@0.2.0 (v0.2.1 available)
Debug:  + react@18.2.0
Debug:  + react-dom@18.2.0
Debug:  + socket.io-client@4.6.1 (v4.7.4 available)
Debug:  + universal-cookie@4.0.4 (v7.0.1 available)
Debug: 
Debug:  installed silly@0.2.0
Debug: 
Debug: 
Debug:  133 packages installed [25.13s]
Debug: Running command: ['/home/cgelinek/.local/share/reflex/bun/bin/bun', 'add', '-d', 'tailwindcss@3.3.2']
Debug: Installing tailwind
Debug: bun add v1.0.13 (f5bf67bd)
Debug:  Resolving dependencies
Debug:  Resolved, downloaded and extracted [278]
Debug:  Saved lockfile
Debug: 
Debug:  installed tailwindcss@3.3.2 with binaries:
Debug:   - tailwind
Debug:   - tailwindcss
Debug: 
Debug: 
Debug:  80 packages installed [8.51s]
Debug: Running command: ['/home/cgelinek/.local/share/reflex/bun/bin/bun', 'add', '@emotion/react@^11.11.0', '@radix-ui/themes@^2.0.0', 
'@chakra-ui/icons@2.0.19', 'focus-visible@5.2.0', '@chakra-ui/react@2.6.1', 'framer-motion@10.16.4', '@emotion/styled@^11.11.0', '@chakra-ui/system@2.5.7']
Debug: Installing frontend packages from config and components
Debug: bun add v1.0.13 (f5bf67bd)
Debug:  Resolving dependencies
Debug:  Resolved, downloaded and extracted [694]
Debug:  Saved lockfile
Debug: 
Debug:  installed @emotion/react@11.11.1
Debug:  installed @radix-ui/themes@2.0.3
Debug:  installed @chakra-ui/icons@2.0.19
Debug:  installed focus-visible@5.2.0
Debug:  installed @chakra-ui/react@2.6.1
Debug:  installed framer-motion@10.16.4
Debug:  installed @emotion/styled@11.11.0
Debug:  installed @chakra-ui/system@2.5.7
Debug: 
Debug: 
Debug:  175 packages installed [28.37s]
Debug: Running command: ['/home/cgelinek/.local/share/reflex/fnm/node-versions/v18.17.0/installation/lib/node_modules/npm/bin/npm-cli.js', 'run', 'next', 
'telemetry', 'disable']
Debug: Running command: ['/home/cgelinek/.local/share/reflex/fnm/node-versions/v18.17.0/installation/bin/node', '-v']
─────────────────────────────────────────────────────────────────────────────── App Running ───────────────────────────────────────────────────────────────────────────────
Debug: Running command: ['/home/cgelinek/.local/share/reflex/fnm/node-versions/v18.17.0/installation/lib/node_modules/npm/bin/npm-cli.js', 'run', 'dev']
Debug: Starting frontend
Debug: 
Debug: > dev
Debug: > next dev
Debug: 
Debug: node:internal/modules/cjs/loader:1080
Debug:   throw err;
Debug:   ^
Debug: 
Debug: Error: Cannot find module 'next/dist/compiled/arg/index.js'
Debug: Require stack:
Debug: - /projects/my_project/interactive/.web/node_modules/next/dist/bin/next
Debug:     at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
Debug:     at /projects/my_project/interactive/.web/node_modules/next/dist/server/require-hook.js:54:36
Debug:     at Module._load (node:internal/modules/cjs/loader:922:27)
Debug:     at Module.require (node:internal/modules/cjs/loader:1143:19)
Debug:     at mod.require (/projects/my_project/interactive/.web/node_modules/next/dist/server/require-hook.js:64:28)
Debug:     at require (node:internal/modules/cjs/helpers:110:18)
Debug:     at Object.<anonymous> (/projects/my_project/interactive/.web/node_modules/next/dist/bin/next:8:55)
Debug:     at Module._compile (node:internal/modules/cjs/loader:1256:14)
Debug:     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
Debug:     at Module.load (node:internal/modules/cjs/loader:1119:32) {
Debug:   code: 'MODULE_NOT_FOUND',
Debug:   requireStack: [
Debug:     '/projects/my_project/interactive/.web/node_modules/next/dist/bin/next'
Debug:   ]
Debug: }
Debug: 
Debug: Node.js v18.17.0
Starting frontend failed with exit code 1

> dev
> next dev

node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module 'next/dist/compiled/arg/index.js'
Require stack:
- /projects/my_project/interactive/.web/node_modules/next/dist/bin/next
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at /projects/my_project/interactive/.web/node_modules/next/dist/server/require-hook.js:54:36
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at mod.require (/projects/my_project/interactive/.web/node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/projects/my_project/interactive/.web/node_modules/next/dist/bin/next:8:55)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/projects/my_project/interactive/.web/node_modules/next/dist/bin/next'
  ]
}

Node.js v18.17.0
Run with --loglevel debug  for the full log.

Specifics (please complete the following information):

Additional context Add any other context about the problem here.

Alek99 commented 8 months ago

That's odd can you try re initing and running again?