MapComplete icon indicating copy to clipboard operation
MapComplete copied to clipboard

Serve `index.html` when you visit localhost:1234

Open RayBB opened this issue 3 years ago • 3 comments

Right now when you visit localhost:1234 it doesn't load anything. You have to manually go to http://localhost:1234/index.html

It would be a small dev experience improvement to have localhost:1234 redirect to index.html or just serve it directly.

RayBB avatar Jan 16 '22 23:01 RayBB

Definitively! I already looked into that, but didn't find right away how to configure this

pietervdvn avatar Jan 16 '22 23:01 pietervdvn

Upgrading to parcel v2 will fix this. However, upgrading to parcel v2 doesn't work right away

At first I got

Error [ERR_WORKER_INVALID_EXEC_ARGV]: Initiated Worker with invalid execArgv flags: --max_old_space_size=12000
    at new NodeError (internal/errors.js:322:7)
    at new Worker (internal/worker.js:196:13)
    at ThreadsWorker.start (/Users/rayberger/Downloads/MapComplete/node_modules/@parcel/workers/lib/threads/ThreadsWorker.js:51:19)
    at Worker.fork (/Users/rayberger/Downloads/MapComplete/node_modules/@parcel/workers/lib/Worker.js:104:23)
    at WorkerFarm.startChild (/Users/rayberger/Downloads/MapComplete/node_modules/@parcel/workers/lib/WorkerFarm.js:232:12)
    at WorkerFarm.startMaxWorkers (/Users/rayberger/Downloads/MapComplete/node_modules/@parcel/workers/lib/WorkerFarm.js:394:14)
    at new WorkerFarm (/Users/rayberger/Downloads/MapComplete/node_modules/@parcel/workers/lib/WorkerFarm.js:139:10)
    at createWorkerFarm (/Users/rayberger/Downloads/MapComplete/node_modules/@parcel/core/lib/Parcel.js:564:10)
    at Parcel._init (/Users/rayberger/Downloads/MapComplete/node_modules/@parcel/core/lib/Parcel.js:231:20)
    at async Parcel.watch (/Users/rayberger/Downloads/MapComplete/node_modules/@parcel/core/lib/Parcel.js:314:7) {
  code: 'ERR_WORKER_INVALID_EXEC_ARGV'
}

So I removed --max_old_space_size=12000

Then I got this error

🚨 Build failed.

unknown: Could not find entry: /Users/rayberger/Downloads/MapComplete/UI/Base

So I'm going to try to follow the migration guide and see how it goes. https://parceljs.org/getting-started/migration/

RayBB avatar Jan 17 '22 02:01 RayBB

@RayBB we might want to re-try https://github.com/pietervdvn/MapComplete/pull/217 with the current version of the app and Vite. Both Parcel2 and Vite need some debugging to get running and Vite is the faster (more modern?) of the two.

tordans avatar Jan 17 '22 07:01 tordans

Switch to Vite has now happened (on develop branch), so this seems to be fixed

RobinLinde avatar Jan 29 '23 12:01 RobinLinde