vite-pwa / remix

Zero-config PWA Plugin for Remix
https://vite-pwa-org.netlify.app/frameworks/remix
MIT License
50 stars 1 forks source link

Unable to Run Example #3

Open e16aasc opened 2 months ago

e16aasc commented 2 months ago

Steps to Reproduce:

  1. Copy the folder remix/examples/pwa-simple-sw into a separate directory.
  2. In package.json, replace "@vite-pwa/remix": "workspace:*" with "@vite-pwa/remix": "^0.0.1".
  3. Run npm i.
  4. Run npm run dev.

Result:

When attempting to access http://localhost:5173/, an error occurs:

[vite] Internal server error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'virtual:'
userquin commented 2 months ago

try including pwa plugin and remix-sw types inside app/vite-env.d.ts via triple slash reference:

// app/vite-env.d.ts
/// <reference types="vite/client" />
/// <reference types="vite-plugin-pwa/client" />
/// <reference types="@vite-pwa/remix/remix-sw" />
mbsyaswanth commented 1 month ago

I tried the same and it did not work. It works, if you build the library in the root and then install in example.

userquin commented 1 month ago

If you're using latest remix-run version (2.9+), we're trying to fix a problem using tsx components in this repo, you can copy/paste the logic in the root.tsx file or copy index.tsx, PWAAssets.tsx and PWAManifest.tsx from component folder and paste them in your app/components folder, then change the import in the root.tsx file.

Check this entry in remix discord server: https://discord.com/channels/770287896669978684/1239208602024280076

Anyway, I'm finishing the remix template in @vite-pwa/create-pwa repo, should fix the problem.