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
I am on Windows and node v14.15.1, but it looks like this should apply everywhere
Description
When you run haul, you get the following message: done ▶︎ Packager server running on http://localhost:8081
You can click on the link from the console, which opens localhost at the root
This causes haul to crash
I see three places to change that would each mitigate this
existsSync returns true for directories, but there is no reason to send a directory path to the compiler. A check to ensure that the path is a file (e.g. with a call to statSync) would prevent this issue
Environment
I am on Windows and node v14.15.1, but it looks like this should apply everywhere
Description
When you run haul, you get the following message:
done ▶︎ Packager server running on http://localhost:8081
You can click on the link from the console, which opens localhost at the root
This causes haul to crash
I see three places to change that would each mitigate this
haul/packages/haul-core-legacy/src/compiler/Compiler.js
Line 149 in dc0b201
There needs to be error handling when reading a file. A simple
try/catch
that invokescallback
with any errors would sufficehaul/packages/haul-core-legacy/src/compiler/worker/initWorker.js
Line 82 in dc0b201
existsSync
returnstrue
for directories, but there is no reason to send a directory path to the compiler. A check to ensure that the path is a file (e.g. with a call tostatSync
) would prevent this issuehaul/packages/haul-core/src/server/setupCompilerRoutes.ts
Line 46 in dc0b201
This sends every unknown path to the compiler, which is not desirable for the root
Adding a simple redirect like the following to setupDevtoolRoutes.ts would catch this and help developers get to their expected destination
Reproducible Demo
This applies to every haul project
The text was updated successfully, but these errors were encountered: