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

No longer working? #2

Open
bmcmurray opened this issue Nov 29, 2018 · 8 comments
Open

No longer working? #2

bmcmurray opened this issue Nov 29, 2018 · 8 comments
Labels
bug Something isn't working

Comments

@bmcmurray
Copy link

Hi @rhodee, I can't seem to get this to work any longer, including running your example app.

No manifest or server worker gets registered and no metatags are injected.

Any insights?

razzle-plugin-pwa@2.2.3
razzle@2.4.0
@rhodee rhodee added the bug Something isn't working label Dec 1, 2018
@rhodee
Copy link
Owner

rhodee commented Dec 1, 2018

Hey @bmcmurray - let me look into this. The plugin itself could also use some updates to be more in-line with the plugin structure for Razzle. I will invest some time in this and get this looked at.

@rhodee
Copy link
Owner

rhodee commented Dec 6, 2018

Hey @bmcmurray I was unfortunately not able to reproduce your experience. I ran the npm run build command and that produced the expected manifests files (manifest.json, precache-manifest.*.json and sw.js) in the examples/build folder.

If you have a repo I can pull down to review, I'd be happy to continue investigating.

@calderaro
Copy link

had a similar issue the problem was "require.resolve(path.join(__dirname, 'public', 'favicon-16x16.png'))" failing without a message but that is on webpack-pwa-manifest

@sixman9
Copy link

sixman9 commented Jul 23, 2019

@calderaro

Add const path = require('path'); to 'razzle.config.js', then supply your PNG files.

@msvargas
Copy link

msvargas commented Oct 19, 2019

In windows add path
....
const path = require("path");
const pwaConfig = {
swDest: path.resolve(__dirname, "build", "sw.js")
};

@lucasreppewelander
Copy link

i suppose i need to add these somehow to the server.js file? I suppose the files you're talking about needs to be able to go into the /static folder?

@lucasreppewelander
Copy link

I did somehting like this to get it inside my server.js html:

<link rel="manifest" href="${
	assets[''].json.filter((i) =>
		i.includes('manifest')
	)[0]
}" />

a bit hacky but dunno if theres another way?

@rwehresmann
Copy link

@lucasreppewelander you could use const fs = require('fs') and

${fs.existsSync(`${process.env.RAZZLE_PUBLIC_DIR}/manifest.json`) && '<link rel="manifest" href="/manifest.json">'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants