Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Run Example #3

Open
e16aasc opened this issue Apr 14, 2024 · 3 comments
Open

Unable to Run Example #3

e16aasc opened this issue Apr 14, 2024 · 3 comments

Comments

@e16aasc
Copy link

e16aasc commented Apr 14, 2024

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
Copy link
Member

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
Copy link

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
Copy link
Member

userquin commented May 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants