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

Running Workbox in DEBUG mode #10555

Open
9jaGuy opened this issue Feb 15, 2021 · 5 comments
Open

Running Workbox in DEBUG mode #10555

9jaGuy opened this issue Feb 15, 2021 · 5 comments

Comments

@9jaGuy
Copy link

9jaGuy commented Feb 15, 2021

Is there an option or a way to run service-worker (generated by workbox) in debug mode?

It seems like workbox checks process.env.NODE_ENV !== 'production' before logging any debug messages

...and we currently only run WorkboxWebpackPlugin when isEnvProduction is true.

Is this intentional, if not what will the best way to give developers a way to debug their service-worker?

@ZYinMD
Copy link

ZYinMD commented Apr 4, 2021

I have the same question.

@ZYinMD
Copy link

ZYinMD commented Apr 7, 2021

The author of the pwa template answered in cra-template/pwa#15 that it can't be easily done. I think it'll be tremendously helpful if CRA can add this option as an environmental variable in .env.

Here is the doc page about the debugging mode, which seems not applicable to CRA.

@9jaGuy
Copy link
Author

9jaGuy commented Apr 7, 2021

Thanks @ZYinMD I did reach out to him and he gave me a similar response. I decided to post this still to see if it is something worth evaluating by the community.

@AntonOfTheWoods
Copy link

The author of the pwa template answered in cra-template/pwa#15 that it can't be easily done.

I don't think that's strictly true, at least not for someone who wrote the code. They just don't want to, because they don't think you should be using service workers for anything but dumb caching. Maybe Safari support is still horrible so they don't want people complaining about "why CRA doesn't work with Safari"?

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants