Reflex 0.4.9 cannot find module next/dist/compiled/webpack/webpack-lib
paoloemilioserra opened this issue Β· comments
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
Is this happening on a new project?
an existing project that was working until yesterday
@paoloemilioserra If you delete your .web folder and re-run reflex init --loglevel debug
then reflex run --loglevel debug
, Does the problem go away?
@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 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.
@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
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
I believe this was resolved on the latest version of reflex. Feel free to reopen if that's not the case.