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

Remove pwa from withPWA return value #368

Conversation

DavidSint
Copy link
Contributor

@DavidSint DavidSint commented Jul 24, 2022

In Next 12.2.3 a change was added saying that the next.config.js "must NOT have additional properties" and that the pwa property was considered as an additional property. Therefore, this commit deletes the pwa property from the calculated next config in the default exported function in index.js (aka the withPWA function). The returned next config therefore does not have the pwa field and the warning does not appear.

Resolves #367

In Next 12.2.3 a change was added saying that the `next.config.js` "must NOT have additional properties" and that the `pwa` property was considered as an additional property. Therefore, this commit deletes the `pwa` property from the calculated next config in the default exported function in index.js (aka the `withPWA` function). The returned next config therefore does not have the `pwa` field and the warning does not appear.
Copy link

@olavoparno olavoparno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you lint according to what was before and only adjust the removal of the PWA key? This gives everyone much more confort in reviewing this PR

@DavidSint
Copy link
Contributor Author

I'm not sure exactly what you mean @olavoparno? Are you saying that the PR violates something from a linting rule?

@olavoparno
Copy link

@DavidSint it is just that it seems you changed the indentation, didn't you?

@olavoparno
Copy link

Oh, you had to create a new object, right? Sorry, I did not notice it.

@DavidSint
Copy link
Contributor Author

Thanks @olavoparno, so now it appears we have to wait for this workflow to be approved to run first

@shadowwalker
Copy link
Owner

Thanks for the pull request. I'm a bit behind obviously.

@shadowwalker shadowwalker merged commit a9111d0 into shadowwalker:master Jul 28, 2022
@felixmosh
Copy link
Contributor

This PR breaks the config, since the webpack function takes the pwa from options.config which (doesn't exists anymore).

@ArianHamdi
Copy link

Same here. I just started with the 5.5.5 version.

@jamesformica
Copy link

Also having an issue. The sw.js (and other files) are no longer being outputted in the public NextJs folder, and are instead being outputted in the .next folder. We are on the latest version of next. This was previously working and nothing in our config has changed other than bumping the patch version. Have downgraded to 5.5.4 but would prefer a proper fix.

@trongithust
Copy link

trongithust commented Aug 17, 2022

This change make pwa from options.config is always {}. So, the plugin doesn't apply any config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid next.config.js with next-pwa
7 participants