You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blitz should be more friendly when run outside a blitz project without arguments.
When running the CLI outside a blitz project an unhandled error is thrown internally. Instead the CLI should provide the user with helpful feedback. Like a list of command arguments or version information. Instead it just seems to crash.
The expected behavior would be that it yields the same output as running blitz inside a project directory, but instead reports in a friendly way that it's not a blitz project. You should still see the version and available commands.
Paste all your error logs here:
$ blitz
C:\Users\nick\AppData\Roaming\npm\node_modules\blitz\node_modules\next\dist\server\lib\utils.js:65
throw new Error('Unable to find project root by looking for your package.json or for ' + _constants.CONFIG_FILE);
^
Error: Unable to find project root by looking for your package.json or for .blitz.config.compiled.js
at getProjectRoot (...\blitz\node_modules\next\dist\server\lib\utils.js:65:15)
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
run "blitz" in an empty folder.
Run blitz -v and paste the output here:
$ blitz -v
Windows 10 | win32-x64 | Node: v16.13.0
blitz: 0.44.0 (global)
Package manager: npm
System:
OS: Windows 10 10.0.22000
CPU: (32) x64 AMD Ryzen 9 3950X 16-Core Processor
Memory: 45.35 GB / 63.92 GB
Binaries:
Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.6.0 - ~\AppData\Roaming\npm\npm.CMD
Watchman: Not Found
npmPackages:
@prisma/client: Not Found
blitz: Not Found
prisma: Not Found
react: Not Found
react-dom: Not Found
typescript: Not Found
Please include below any other applicable logs and screenshots that show your problem:
No response
The text was updated successfully, but these errors were encountered:
That's odd. It should print the following message:
~/workspace/random-dir blitz
› Error: You are not inside a Blitz project, so this command won't work.
› You can create a new app with blitz new myapp or see help with blitz help
beerose
changed the title
Blitz throws unhandled error when run outside a project.
Blitz throws unhandled error when run outside a project on Windows
Dec 15, 2021
What is the problem?
Blitz should be more friendly when run outside a blitz project without arguments.
When running the CLI outside a blitz project an unhandled error is thrown internally. Instead the CLI should provide the user with helpful feedback. Like a list of command arguments or version information. Instead it just seems to crash.
The expected behavior would be that it yields the same output as running
blitz
inside a project directory, but instead reports in a friendly way that it's not a blitz project. You should still see the version and available commands.Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response
The text was updated successfully, but these errors were encountered: