Coder Social home page Coder Social logo

Comments (10)

userquin avatar userquin commented on June 6, 2024 1

you need to add an svg (or png) to your public folder, then configure pwaAssets in your pwa options to build all pwa stuff, check the example where we use external pwa assets configuration file (https://github.com/QwikDev/pwa/blob/main/example/pwa-assets.config.ts): add pwaAssets: true (you can also inline pwa assets configuration)

from pwa.

Aslemammad avatar Aslemammad commented on June 6, 2024

Hey, Thank you so much for the issue, can we have a stackblitz reproduction?

from pwa.

userquin avatar userquin commented on June 6, 2024

@Jauharmuhammed can you try adding "@qwikdev/pwa" to your ts config file (compilerOptions.types array)? ("vite/client" should be also there )

"compileOptions": {
  "types": ["vite/client", "@qwikdev/pwa"]
}

If not using TypeScript, try adding vite-env.d.ts in your src folder adding triple slash reference:

// vite-env.d.ts
/// <reference types="@qwikdev/pwa" />

from pwa.

Jauharmuhammed avatar Jauharmuhammed commented on June 6, 2024

@userquin I have tried adding what you suggested, still the same issue

@Aslemammad I have added a link to the stackblitz reproduction in the description

from pwa.

Aslemammad avatar Aslemammad commented on June 6, 2024

Thank you so much! @userquin what do you think?

from pwa.

userquin avatar userquin commented on June 6, 2024

@Jauharmuhammed you need to add qwikPwa plugin to Vite plugins, missing in the playground (updated link):

/**
 * This is the base config for vite.
 * When building, the adapter config is used which loads this file and extends it.
 */
import { defineConfig } from 'vite';
import { qwikVite } from '@builder.io/qwik/optimizer';
import { qwikCity } from '@builder.io/qwik-city/vite';
import tsconfigPaths from 'vite-tsconfig-paths';

import { qwikPwa } from "@qwikdev/pwa";  // <== add this import

/**
 * Note that Vite normally starts from `index.html` but the qwikCity plugin makes start at `src/entry.ssr.tsx` instead.
 */
export default defineConfig(() => {
  return {
    define: {
      // (optional) enables debugging in workbox
      'process.env.NODE_ENV': JSON.stringify('development'),
    },
    plugins: [qwikCity(), qwikVite(), tsconfigPaths(), qwikPwa({/* pwa options */})], // <== and the pwa plugin here
  };
});

from pwa.

Jauharmuhammed avatar Jauharmuhammed commented on June 6, 2024

I missed that, the project is running fine now, but it not PWA compatible!

The icon to install the pwa is not showing up and I tested with lighthouse as well

from pwa.

userquin avatar userquin commented on June 6, 2024

@Aslemammad we should add pwa assets configuration to the readme file

from pwa.

userquin avatar userquin commented on June 6, 2024

@Jauharmuhammed check this page as small guide https://vite-pwa-org.netlify.app/assets-generator/integrations.html (not 100% compatible, since qwikdev pwa using custom integration)

Check also pwaAssets option here https://vite-pwa-org.netlify.app/assets-generator/integrations.html#pwa-assets-options

from pwa.

Aslemammad avatar Aslemammad commented on June 6, 2024

@Aslemammad we should add pwa assets configuration to the readme file

I agree, we should do that.

from pwa.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.