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

Reflex 0.4.9 cannot find module next/dist/compiled/webpack/webpack-lib #3171

Open
paoloemilioserra opened this issue Apr 26, 2024 · 7 comments
Labels
bug Something isn't working needs investigation

Comments

@paoloemilioserra
Copy link

paoloemilioserra commented Apr 26, 2024

Describe the bug
Launching reflex run at the command line results in an error and the app is not reachable in local

To Reproduce
Just launching reflex run

Expected behavior
Launch the front end

Screenshots
None

Specifics (please complete the following information):

  • Python Version: 3.11
  • Reflex Version: 0.4.9
  • OS: Windows 10.0.19045
  • Browser (Optional): Chrome

Additional context

(.venv) C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev>reflex run --loglevel debug
───────────────────────────────────────────────────────────────────────────────────────────────────────────── System Info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────Debug: Config file: 'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\iip-dev\\.venv\\Lib\\site-packages\\reflex\\config.py'
Debug: Config: app_name='iis_dev' 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='C:\\Users\\serrap\\AppData\\Local\\reflex\\bun\\bin\\bun.exe' cors_allowed_origins=['*'] tailwind={} timeout=120 next_compression=True event_namespace=Nonefrontend_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: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\node-versions\\v18.17.0\\installation\\node.exe', '-v']
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\fnm.exe', '--version']
Debug: [Reflex 0.4.9 with Python 3.11.7 (PATH: C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.venv\Scripts\python.exe)]
Debug: [Node 18.17.0 (Expected: 18.17.0) (PATH:C:\Users\serrap\AppData\Local\reflex\fnm\node-versions\v18.17.0\installation\node.exe)]
Debug: [FNM 1.35.1 (Expected: 1.35.1) (PATH: C:\Users\serrap\AppData\Local\reflex\fnm\fnm.exe)]
Debug: [OS Windows 10.0.19045]
Debug: Using package installer at: C:\Users\serrap\AppData\Local\reflex\bun\bin\bun.exe
Debug: Using package executer at: C:\Users\serrap\AppData\Local\reflex\fnm\node-versions\v18.17.0\installation\npm
Warning: Windows Subsystem for Linux (WSL) is recommended for improving initial install times.
───────────────────────────────────────────────────────────────────────────────────────────────────────── Starting Reflex App ──────────────────────────────────────────────────────────────────────────────────────────────────────────ERROR:root:S6 is longer than 500 characters
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\node-versions\\v18.17.0\\installation\\npm', 'run', 'next', 'telemetry', 'disable']
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\node-versions\\v18.17.0\\installation\\node.exe', '-v']
───────────────────────────────────────────────────────────────────────────────────────────────────────────── App Running ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\node-versions\\v18.17.0\\installation\\npm', 'run', 'dev']
Debug: Starting frontend
Debug: 
Debug: > dev
Debug: > next dev
Debug: 
Debug: node:internal/modules/cjs/loader:1077
Debug:   const err = new Error(message);
Debug:               ^
Debug: 
Debug: Error: Cannot find module 'next/dist/compiled/webpack/webpack-lib'
Debug: Require stack:
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\server\config-utils.js
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\server\config.js
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\cli\next-dev.js
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\lib\commands.js
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\bin\next
Debug:     at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
Debug:     at C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\server\require-hook.js:54:36
Debug:     at Function.resolve (node:internal/modules/cjs/helpers:116:19)
Debug:     at C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\server\config-utils.js:185:21
Debug:     at Array.map (<anonymous>)
Debug:     at loadWebpackHook (C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\server\config-utils.js:182:7)
Debug:     at loadConfig (C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\server\config.js:643:46)
Debug:     at nextDev (C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\cli\next-dev.js:191:40)
Debug:     at async main (C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\iip-dev\.web\node_modules\next\dist\bin\next:150:5) {
Debug:   code: 'MODULE_NOT_FOUND',
Debug:   requireStack: [
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\iip-dev\\.web\\node_modules\\next\\dist\\server\\config-utils.js',
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\iip-dev\\.web\\node_modules\\next\\dist\\server\\config.js',
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\iip-dev\\.web\\node_modules\\next\\dist\\cli\\next-dev.js',
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\iip-dev\\.web\\node_modules\\next\\dist\\lib\\commands.js',
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\iip-dev\\.web\\node_modules\\next\\dist\\bin\\next'
Debug:   ]
Debug: }
Debug:
Debug: Node.js v18.17.0
Starting frontend failed with exit code 1

@paoloemilioserra paoloemilioserra changed the title Reflex 0.4.9 cannot find module next/dis Reflex 0.4.9 cannot find module next/dist/compiled/webpack/webpack-lib Apr 26, 2024
@ElijahAhianyo
Copy link
Collaborator

Is this happening on a new project?

@paoloemilioserra
Copy link
Author

an existing project that was working until yesterday

@ElijahAhianyo
Copy link
Collaborator

@paoloemilioserra If you delete your .web folder and re-run reflex init --loglevel debug then reflex run --loglevel debug, Does the problem go away?

@paoloemilioserra
Copy link
Author

paoloemilioserra commented Apr 26, 2024

@ElijahAhianyo Unfortunately no, I tried it already and the only thing that seems to fix it is to downgrade to 0.4.7 but then I have issues with the back end getting unreachable

@ElijahAhianyo ElijahAhianyo added bug Something isn't working needs investigation labels Apr 26, 2024
@ElijahAhianyo
Copy link
Collaborator

@ElijahAhianyo Unfortunately no, I tried it already and the only thing that seems to fix it is to downgrade to 0.4.7 but then I have issues with the back end getting unreachable

Just to confirm if you haven't tried already, but do you get the same error when you run a new blank project?

Also if you by any means have the code in a public repo that I can try to repro and can share the link, that would be great.

@paoloemilioserra
Copy link
Author

paoloemilioserra commented Apr 26, 2024

@ElijahAhianyo yes it happens in a new project as well. I cannot have a public repo unfortunately

(.venv) C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex>reflex run --loglevel debug
───────────────────────────────────────────────────────────────────────────────────────────────────────────── System Info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
Debug: Config file: 'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\test-reflex\\.venv\\Lib\\site-packages\\reflex\\config.py'
Debug: Config: app_name='test_reflex' 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='C:\\Users\\serrap\\AppData\\Local\\reflex\\bun\\bin\\bun.exe' 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: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\node-versions\\v18.17.0\\installation\\node.exe', '-v']
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\fnm.exe', '--version']
Debug: [Reflex 0.4.9 with Python 3.11.7 (PATH: C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.venv\Scripts\python.exe)]
Debug: [Node 18.17.0 (Expected: 18.17.0) (PATH:C:\Users\serrap\AppData\Local\reflex\fnm\node-versions\v18.17.0\installation\node.exe)]
Debug: [FNM 1.35.1 (Expected: 1.35.1) (PATH: C:\Users\serrap\AppData\Local\reflex\fnm\fnm.exe)]
Debug: [OS Windows 10.0.19045]
Debug: Using package installer at: C:\Users\serrap\AppData\Local\reflex\bun\bin\bun.exe
Debug: Using package executer at: C:\Users\serrap\AppData\Local\reflex\fnm\node-versions\v18.17.0\installation\npm
Warning: Windows Subsystem for Linux (WSL) is recommended for improving initial install times.
Info: The backend will run on port 8001.
Info: Overriding config value backend_port with env var BACKEND_PORT=8001
───────────────────────────────────────────────────────────────────────────────────────────────────────── Starting Reflex App ──────────────────────────────────────────────────────────────────────────────────────────────────────────
Compiling: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 15/15 0:00:00
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\node-versions\\v18.17.0\\installation\\npm', 'run', 'next', 'telemetry', 'disable']
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\node-versions\\v18.17.0\\installation\\node.exe', '-v']
───────────────────────────────────────────────────────────────────────────────────────────────────────────── App Running ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\fnm\\node-versions\\v18.17.0\\installation\\npm', 'run', 'dev']
Debug: Starting frontend
Debug: 
Debug: > dev
Debug: > next dev
Debug:
Info: Overriding config value backend_port with env var BACKEND_PORT=8001
Debug: node:internal/modules/cjs/loader:1077
Debug:   const err = new Error(message);
Debug:               ^
Debug:
Debug: Error: Cannot find module 'next/dist/compiled/webpack/webpack-lib'
Debug: Require stack:
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\server\config-utils.js
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\server\config.js
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\cli\next-dev.js
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\lib\commands.js
Debug: - C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\bin\next
Debug:     at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
Debug:     at C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\server\require-hook.js:54:36
Debug:     at Function.resolve (node:internal/modules/cjs/helpers:116:19)
Debug:     at C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\server\config-utils.js:185:21
Debug:     at Array.map (<anonymous>)
Debug:     at loadWebpackHook (C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\server\config-utils.js:182:7)
Debug:     at loadConfig (C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\server\config.js:643:46)
Debug:     at nextDev (C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\cli\next-dev.js:191:40)
Debug:     at async main (C:\Users\serrap\OneDrive - Autodesk\Documents\GitHub\test-reflex\.web\node_modules\next\dist\bin\next:150:5) {
Debug:   code: 'MODULE_NOT_FOUND',
Debug:   requireStack: [
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\test-reflex\\.web\\node_modules\\next\\dist\\server\\config-utils.js',
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\test-reflex\\.web\\node_modules\\next\\dist\\server\\config.js',
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\test-reflex\\.web\\node_modules\\next\\dist\\cli\\next-dev.js',
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\test-reflex\\.web\\node_modules\\next\\dist\\lib\\commands.js',
Debug:     'C:\\Users\\serrap\\OneDrive - Autodesk\\Documents\\GitHub\\test-reflex\\.web\\node_modules\\next\\dist\\bin\\next'
Debug:   ]
Debug: }
Debug:
Debug: Node.js v18.17.0
Starting frontend failed with exit code 1

@ElijahAhianyo
Copy link
Collaborator

ElijahAhianyo commented Apr 26, 2024

Just looking at the logs, I can't tell why after "starting Reflex App", there are no logs for installing packages before jumping straight to "App Running". should ideally see logs like:

───────────────────────────────────────────────────────────────────────────────────────────────────────── Starting Reflex App ──────────────────────────────────────────────────────────────────────────────────────────────────────────
Compiling: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 15/15 0:00:00
Debug: Running command: ['C:\\Users\\serrap\\AppData\\Local\\reflex\\bun\\bin\\bun.exe', 'install']
Debug: Installing base frontend packages
Debug bun install v1.1.3()
...

Will need to investigate this further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants