remix-pwa: [v3] Path resolution issue on Windows + broken build script
Hi,
I’m attempting to upgrade to v3, but running into some problems. First, it appears there may be a path resolution issue on Windows. When I try to run remix-pwa build
or remix-pwa dev
, I get the following error:
> remix-pwa build
node:internal/errors:496
ErrorCaptureStackTrace(err);
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at new NodeError (node:internal/errors:405:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:131:11)
at defaultLoad (node:internal/modules/esm/load:82:3)
at nextLoad (node:internal/modules/esm/loader:163:28)
at ESMLoader.load (node:internal/modules/esm/loader:603:26)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
at new ModuleJob (node:internal/modules/esm/module_job:64:26)
at #createModuleJob (node:internal/modules/esm/loader:480:17)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
Windows 11 Node 18
@remix-pwa/cache: 2.0.5 @remix-pwa/strategy: 2.1.3 @remix-pwa/sw: 2.1.4 @remix-pwa/dev: 2.0.19 @remix-pwa/worker-runtime: 2.0.5 remix-pwa: 3.0.10
P.S. To confirm this was a Windows thing, I attempted to build the worker on macOS and it doesn’t error, but it doesn’t build the worker either (doesn’t show up in public
). However, remix-pwa dev
DOES build the worker (public/entry.worker.js
). Still investigating that one.
Thanks for all your work!
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 37 (23 by maintainers)
I created a PR to solve all the windows related issues in the compiler! I did run some test in a Windows 11 computer myself and was the service-worker was bundled correctly.
Success, thank you!
Creating a stable release soon enough, then releasing a new
remix-pwa
version 👍Fix coming out soon
I just realized
remix-pwa build
is not producingpublic/entry.worker.js
on macOS, either. So this particular aspect isn’t Windows specific. (I hadn’t tried it again sinceremix-pwa dev
was fixed on Windows.)Nothin’. Just says
Building Service Worker in production mode
and exits, nopublic/entry.worker.js
.remix-pwa dev
seems to work now! 🎉 Still not seeing the worker get output fromremix-pwa build
, though. I assumed they were related, but perhaps that’s a separate issue?Sorry. 😔 And nah,
entry.worker.js
was never built.Ah, okay - I was mainly referring to Patryk’s fixes.
Yep.
My stack trace shows error at line 22
and changing the path to use
resolveUrl
fixes the errorThat was quick! I was going open a second issue for this but ran out of time to gather more info. 😅 Nice find.