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

[Bug]: dest property instead of swDest in WebpackInjectManifest #25

Closed
rtritto opened this issue Jan 3, 2024 · 2 comments
Closed

[Bug]: dest property instead of swDest in WebpackInjectManifest #25

rtritto opened this issue Jan 3, 2024 · 2 comments
Assignees
Labels
bug Something isn't working triage New issues get this label, remove it after triage

Comments

@rtritto
Copy link

rtritto commented Jan 3, 2024

Provide environment information

  • @serwist/next: 8.3.0
  • @serwist/sw: 8.3.0
  • next: 14.0.4
  • react: 18.2.0
  • react-dom: 18.2.0
  • webpack: 5.89.0

Which project is this issue for?

@serwist/next

Link to reproduction - Issues with a link to complete (but minimal) reproduction code help us address them faster

NA

To reproduce

  • yarn init -y
  • yarn set version berry
  • yarn add next react react-dom @serwist/next @serwist/sw webpack
  • create empty pages folder
  • create next.config.mjs
import withPWA from '@serwist/next'

const isDev = process.env.NODE_ENV === 'development'

const nextConfig = {}

export default withPWA({
  dest: 'public',
  disable: isDev,
  cacheOnFrontEndNav: true,
  swSrc: 'app/sw.js',
  swDest: 'public/sw.js'
})(nextConfig)
  • yarn next build
   ▲ Next.js 14.0.4
   - Environments: .env

 ✓ (serwist) Compiling for server...
 ✓ (serwist) Compiling for server...
 ✓ (serwist) Compiling for client (static)...
 ○ (serwist) Service worker: C:\<PROJECT_NAME>\public\sw.js
 ○ (serwist)   URL: /sw.js
 ○ (serwist)   Scope: /
Failed to compile.

Please check your InjectManifest plugin configuration:
[WebpackInjectManifest] 'dest' property is not expected to be here. Did you mean property 'swDest'?

Cannot read properties of undefined (reading 'source')

Describe the bug

The build phase fails with error:

Please check your InjectManifest plugin configuration:
[WebpackInjectManifest] 'dest' property is not expected to be here. Did you mean property 'swDest'?

Cannot read properties of undefined (reading 'source')

The error should be related to InjectManifest of @serwist/webpack-plugin.

Expected behavior

Build is completed with no errors

Screenshots (if relevant)

No response

Additional information (if relevant)

No response

@rtritto rtritto added bug Something isn't working triage New issues get this label, remove it after triage labels Jan 3, 2024
@DuCanhGH
Copy link
Member

DuCanhGH commented Jan 3, 2024

Remove dest: "public". It is no longer a valid option.

Changes between @ducanh2912/next-pwa@9.7.2 and @serwist/next@8.0.0 are listed here.

@rtritto
Copy link
Author

rtritto commented Jan 3, 2024

Worked, thanks!

@rtritto rtritto closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues get this label, remove it after triage
Projects
None yet
Development

No branches or pull requests

2 participants