-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Error while building the next-9 example #10
Comments
I will check this. Thanks for create this issue. |
@vishwasnavadak Hi, reproduce confirmed. This is due to an update to 5.0 in workbox, they deprecated some parameters and caused this breaking change. If this is important to you, please use |
@shadowwalker Sure will do. Thanks for the help |
@vishwasnavadak Hi, I just finished the fix. Could you try out the latest change? |
@shadowwalker That was a very quick fix. It works !! Thank you! |
@shadowwalker Same issue is arising with v2.40 yarn run v1.21.1
$ next build
> [PWA] Compile client (static)
> [PWA] Auto register service worker with: <dir>\next-pwa\examples\next-9\node_modules\next-pwa\register.js
> [PWA] Service worker:<dir>\next-pwa\examples\next-9\public\sw.js
> [PWA] url: \sw.js
> [PWA] scope: \
> [PWA] Compile server
Creating an optimized production build
Failed to compile.
chunk static/runtime/main.js [initial]
static/runtime/main-e2f6bbe4483af32f35ee.js
<dir>\next-pwa\examples\next-9\node_modules\next-pwa\register.js c41b81e2b7b93250b27effc664089e9b
Unterminated string constant (4:89)
|
| if (typeof window !== 'undefined' && 'serviceWorker' in navigator) {
| window.workbox = new __WEBPACK_MODULE_REFERENCE__0_576f726b626f78__("\sw.js", { scope: "\" })
| if(true) window.workbox.register()
| }
> Build error occurred
Error: > Build failed because of webpack errors
at build (<dir>\next-pwa\examples\next-9\node_modules\next\dist\build\index.js:13:900)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. |
Here is the error as it is not escaping \ if no scope is defined:
|
Fixed with commit |
Issue
Error while trying to install and build the example for installing
next-pwa
on Next v9+ .Expected Output
Successful Build with PWA ready Next App
Steps
npm install
npm run build
The text was updated successfully, but these errors were encountered: