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

Service worker does not include app.css in manifest #1631

Closed
ficoos opened this issue Jun 12, 2019 · 11 comments
Closed

Service worker does not include app.css in manifest #1631

ficoos opened this issue Jun 12, 2019 · 11 comments
Labels
ionitron: needs reproduction This PR or Issue does not have a reproduction case URL

Comments

@ficoos
Copy link

ficoos commented Jun 12, 2019

Stencil version:

I'm submitting a:

[ x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:
When using service workers in development mode app.css is not included in the sw precache manifest.

Expected behavior:
app.css is included

Steps to reproduce:
stencil build --dev --watch --serve --serviceWorker

Related code:

// insert any relevant code here

Other information:

When building in development you can see the the generate style and generate service worker stages happen concurrently. There might be a race between the sw globber and the style generation code

@ionitron-bot ionitron-bot bot added the triage label Jun 12, 2019
@manucorporat
Copy link
Contributor

why do you expect it included?

@ficoos
Copy link
Author

ficoos commented Jun 13, 2019

It's needed for the site to be available offline. Without it you don't have the global css available when you are offline. This makes testing the site's offline behavior on a dev server impossible.

@manucorporat
Copy link
Contributor

manucorporat commented Jun 13, 2019

can you share your src/index.html?

@ficoos
Copy link
Author

ficoos commented Jun 17, 2019

<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
  <meta charset="utf-8">
  <title>PWA</title>

  <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="description" content="PWA">
  <meta name="theme-color" content="#16161d">

  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">

  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-title" content="Ionic PWA">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">

  <meta http-equiv="x-ua-compatible" content="IE=Edge">

  <link href="/build/app.css" rel="stylesheet">
  <script type="module" src="/build/app.esm.js"></script>
  <script nomodule src="/build/app.js"></script>
  <link rel="apple-touch-icon" sizes="180x180" href="/assets/icon/apple-touch-icon.png">
  <link rel="icon" type="image/x-icon" href="/assets/icon/favicon.ico">
  <link rel="manifest" href="/manifest.json">
</head>

<body>

  <app-root></app-root>

</body>

</html>

@michael42
Copy link

michael42 commented Jun 3, 2020

It seems that @stencil/core 1.14.0 explicitly ignores the main css and js files via globIgnores (see addGlobIgnores in stencil.js), which makes the resulting service worker rather pointless. It caches the HTML file, but then everything that file references is missing.

@michael42
Copy link

I'll retract my statement. When using href="/build/app.css" and src="/build/app.esm.js", these references will be rewritten into the p-... files that are cached by the ServiceWorker. I used relative references (build/app.esm.js), which are neither rewritten (in the index.html) nor cached by the ServiceWorker.

@MrAntix
Copy link
Contributor

MrAntix commented Nov 22, 2020

relates to #2687

@splitinfinities
Copy link
Contributor

Hey everyone, thank you for the patience. Would anyone happen to know if this behavior exists within v2? If we could update the repro case for these, I would appreciate it, and it would help us diagnose and solve this problem sooner than later.

@ionitron-bot ionitron-bot bot added the ionitron: stale issue This issue has not seen any activity for a long period of time label Sep 2, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 2, 2021

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

@ionitron-bot ionitron-bot bot closed this as completed Sep 2, 2021
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 2, 2021
@rwaskiewicz
Copy link
Member

Hey ionitron-bot, we didn't mean to close this. Bad bot!

@rwaskiewicz rwaskiewicz reopened this Sep 3, 2021
@rwaskiewicz rwaskiewicz removed the ionitron: stale issue This issue has not seen any activity for a long period of time label Sep 3, 2021
@rwaskiewicz rwaskiewicz added Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team and removed Feature: Workers labels Mar 25, 2022
@rwaskiewicz rwaskiewicz added ionitron: needs reproduction This PR or Issue does not have a reproduction case URL and removed Repro: No Awaiting Reply This PR or Issue needs a reply from the original reporter. Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team labels Apr 4, 2022
@rwaskiewicz
Copy link
Member

This issue is being closed due to the lack of a code reproduction. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: needs reproduction This PR or Issue does not have a reproduction case URL
Projects
None yet
Development

No branches or pull requests

6 participants