nuxt: Unable to run dev script with static target and modern client

Version

v2.13.0

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)

Commits related to this issue

Most upvoted comments

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 on yarn build && yarn export (for production). So I am cheating a little and setting modern: process.env.NODE_ENV === 'production' in nuxt.config.js

v2.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 when dev === 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.