score:0
Before I was doing it like this,
module.exports = withBundleAnalyzer(
withPWA({
pwa: {
dest: 'public',
runtimeCaching,
},
poweredByHeader: false,
})
)
module.exports =
{
env: {
BASE_URL: process.env.BASE_URL,
},
future: {
webpack5: true,
},
reactStrictMode: true,
}
Not sure but I think you should only need to have one module.exports
so I wrapped my other stuff inside the withBundleAnalyzer
like this
module.exports = withBundleAnalyzer(
withPWA({
pwa: {
dest: 'public',
runtimeCaching,
},
poweredByHeader: false,
}),
{
env: {
BASE_URL: process.env.BASE_URL,
},
future: {
webpack5: true,
},
reactStrictMode: true,
}
)
score:2
Looks like this has been answered on Vercel's issues board. Copying their solution here:
These plugins are functions that enhance the configuration object, so you have to wrap them instead of providing them as arguments:
const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer(withPWA({
pwa: {
dest: 'public',
runtimeCaching,
},
poweredByHeader: false,
}));
Source: stackoverflow.com
Related Query
- next.js bundle analyzer isn't creating pages to vew bundles
- Next js - disable server side rendering on some pages
- How to analyze Next Js bundle size and content
- How to bundle in Webpack assets in multiple pages that don't link to every other assets?
- Next JS npm start app load 404 page not found error for physical pages
- Pages are reloaded instead of routed in shopify next js app
- Redux toolkit store reset automatically in navigating between pages in next js
- How to pass a component to all pages except one next js
- Global styles for specific pages in next js
- Add pages to dynamic routes on runtime Next Js
- Creating custom pagination, but next and prev buttons are not working
- How to fix "TypeError: Cannot read property 'node' of undefined" when creating pages programmatically in gatsbyjs
- Next js multiple dynamic pages
- Using useContext to set dark mode for all pages in Next JS and Material UI
- Gatsby: Creating Pages from Contentful Fields
- Programmatically creating links for static pages with next.js
- Is it possible to embed pages inside page in Next JS?
- Creating 60k+ pages slows down page performance
- ReactJS components in same bundle across different pages
- Programatically creating pages in Gatsby using Json
- React Router: Creating pages dynamically from the Wordpress REST API
- What is npm run build command and how webpack is used in creating bundle file
- Creating specificity in Material UI Next and React
- Next Js - Inner pages loading the home page content on Page Refresh
- Creating react pages with unique urls
- Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release
- What is the meaning of 'No bundle URL present' in react-native?
- Cannot find namespace 'ctx' error when creating Context with react - typescript
- Creating custom function in React component
- When to use a react framework such as Next or Gatsby vs Create React App
More Query from same tag
- How to focus something on next render with React Hooks
- React functional component default parameters
- Override MUI component root node element with styled()
- How to set TextField to empty string?
- How to pass react-bootstrap carousel items to a Map function?
- Adding AJAX success/error message to Formcarry
- Switching images with time of day in react.js
- Retrieve values from db to drop down in ant form
- INPUT fields and SUBMIT button are not "disabled". Why?
- cannot increment item in cart
- I can't call the modal component in other component correctly on React
- How to change color of icon and text once clicked or hovering?
- Communicating beteween parent and child with row ReactJs
- Dropdown doesn't work in a loop but normal
- UseEffect not fetching data with axios
- React only binds Component methods to this - work around?
- Can't get a buttons background image to display
- How to get temperature units on weather api call?
- Unable to execute if statement
- Should we use PropTypes for Redux state?
- How to sort data in ReactJs
- How to handle a different type of event with a handler, specifically a dropdown and not a textfield. SPFX/React
- How to update the state based on my initial state
- How can I add navbar band logo at center using react bootstrap in react js
- Triggering dragenter only on parent and not on children?
- I am using react js and jsx and css using webpack and my code fails to compile when I add an image to the css
- create-react-app issue with IIS hosting and IE
- list in an object nested in an array react
- React Router rendering 404 Not Found on reload
- Add element to List that is inside a Map (ImmutableJS)