-
Notifications
You must be signed in to change notification settings - Fork 110
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
never get service-worker.js even with examples in the package #171
Comments
Can you share a repo where this issue is reproduce able? Given what you've shared it's impossible to tell what isn't working |
I think I've been having the same issue. I grabbed
error now and trying to load I'd love to know if anyone's able to deploy that |
Same here- |
@shahruz @ahmedB7r @krishaamer master is currently using an alpha version of workbox which has a known bug in it.GoogleChrome/workbox#2138 The Now 2.0 example on the 4.0 branch should work fine. https://github.com/hanford/next-offline/tree/v4/examples/now2 Updated the version 5 beta to use the latest workbox version, which fixes the bug so the Now 2.0 example should work fine for both! |
That fixed it for me. Thanks! |
it's worked thanks :) @hanford |
I run the now2-example and get this error: "Error: Cannot start server when target is not server". :( |
@machiaveli88 can you elaborate a little bit more? how are you trying to start the now 2.0 example? when was the last time you pulled it down? (it was updated yesterday w/ some fixes) |
Hey, thanks for your answer! |
that should be fixed from this PR #176 Can you pull down and give it another try @machiaveli88 |
Right now with that latest commit running yarn && yarn dev I am getting:
|
same error |
A contributor landed a fix for this: #177 Should be live in This 5.0 release will be a large change, so I really appreciate the back and forth! |
same here :(
|
@machiaveli88 So Now 2.0 works very differently than the other now examples. This example is only really running well when it's actually deploying to Now 2.0 it looks like. The big gotcha here is Now 2.0 is handling all of the routing once deployed, whereas when running locally we're not getting that functionality. In the Zeit released something called I'm using Now 2.0 and next-offline on my personal website. The source is over here: https://github.com/hanford/personal-website and you can see that offline is working if you visit the url: https://jackhanford.com |
Thanks for this package, I really like the work you saved me :) However I am experiencing the same issue (after running
These are my dependencies:
I am using Also, I tried
When I tried
Have someone run into this as well, or knows what I am doing wrong? :) |
@hanford Do you have an idea what am I doing wrong? |
Ok, first of all sorry for not including my const withOffline = require("next-offline");
// https://github.com/hanford/next-offline#now-20
const nextConfig = {
// NOTE: this is present in the example, but breaks on dev
// target: "serverless",
transformManifest: manifest => ["/"].concat(manifest), // add the homepage to the cache
// Trying to set NODE_ENV=production when running yarn dev causes a build-time error so we
// turn on the SW in dev mode so that we can actually test it
generateInDevMode: false,
workboxOpts: {
swDest: "static/service-worker.js",
runtimeCaching: [
{
urlPattern: /^https?.*/,
handler: "NetworkFirst",
options: {
cacheName: "https-calls",
networkTimeoutSeconds: 15,
expiration: {
maxEntries: 150,
maxAgeSeconds: 30 * 24 * 60 * 60 // 1 month
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
}
};
module.exports = withOffline(nextConfig); |
same issue here "next-offline": "^5.0.0-beta.8" |
I think there should be a part in documentation for people who are not using 'now' and want to deploy it to their own host |
@maysam, I’d love a PR! |
Any updates on this? As a prospective dev looking at this repo, it's unclear whether PWAs via next-offline actually work fully? |
@AdityaAnand1 I'm considering removing the generateInDev mode flag, it seems like it's causing people more harm then good. |
using "next-offline": "^5.0.2", `Failed to compile. Please check your GenerateSW plugin configuration: |
@karthik-js it's possible |
i just always get this
(pending)
in the req , please helpThe text was updated successfully, but these errors were encountered: