nuxt: Unable to run dev script with static target and modern client
Version
Reproduction link
https://github.com/hannes-k/nuxt-modern
Steps to reproduce
Create new nuxt project
add target: 'static'
and modern: 'client'
to nuxt.config.js
npm run dev
ctrl + c
npm run dev
What is expected ?
Developer mode should be started.
What is actually happening?
ERROR Cannot read property 'filter' of undefined 14:27:24
at node_modules/@nuxt/webpack/dist/webpack.js:176:12
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Additional comments?
The error does not always occur. Sometimes it works, but the next time it does not.
<div align="right">This bug report is available on Nuxt community (#c10805)</div>About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 17
- Comments: 28 (7 by maintainers)
Links to this issue
- Update dependency nuxt to ^2.17.1 (!958) · Merge requests · GitLab.org / gitlab-svgs · GitLab
- Update dependency nuxt to ^2.17.1 (!958) · Merge requests · GitLab.org / gitlab-svgs · GitLab
- Update dependency nuxt to v3 (!963) · Merge requests · GitLab.org / gitlab-svgs · GitLab
- Update dependency nuxt to v3 (!963) · Merge requests · GitLab.org / gitlab-svgs · GitLab
Commits related to this issue
- fix(webpack): modern build should wait for legacy assets (#7635) #7562 — committed to nuxt/nuxt by clarkdo 4 years ago
On my build the issue is modern browsers can’t open the build but legacy one can. I suppose modern build is failing. I observe this issue on
yarn dev
but not onyarn build && yarn export
(for production). So I am cheating a little and settingmodern: process.env.NODE_ENV === 'production'
in nuxt.config.jsv2.14.4 released 😃
@kreig303 @shainegordon Thanks for providing info about how to reproduce the issue, the issue is because of racing condition between modern and legacy build, I’ve opened a pr to fix it, if you want to try it in advance, you can verify it by applying my pr change to you local @nuxt/webpack in node_module.
i did some extensive work with that app in the last day. the
modern:client
whendev === true
demons seem to have been exorcised.thanks for all your help @clarkdo
again spoke too soon. issue seems to be all about
modern: client
. would love to have esm builds but disabling them altogether will be our current workaround. ☹️observed behavior seems to be similar to #6442, btw. this issue got conflated (for us) with the webpack stall on modern builds that was fixed in 2.13.3 as mentioned above.