unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.48k stars 472 forks source link

ERROR Rollup error: Cannot read properties of null (reading 'included') #200

Closed vencho-mdp closed 1 month ago

vencho-mdp commented 2 years ago

Environment

Nitro: Latest Node: v16.14.2

Reproduction

Go to the Nitro Playground and Run nitro dev

Or check on Stackblitz: https://stackblitz.com/github/unjs/nitro/tree/main/examples/hello-world?file=package.json

Describe the bug

No index route is generated plus the error above is shown in the console

Additional context

No response

Logs

ERROR  Rollup error:  Cannot read properties of null (reading 'included')                 nitro 19:01:34

  at Module.isIncluded (node_modules/rollup/dist/es/shared/rollup.js:12683:25)
  at eval (node_modules/rollup/dist/es/shared/rollup.js:16138:17)
  at Array.filter (<anonymous>)
  at getIncludedModules (node_modules/rollup/dist/es/shared/rollup.js:16137:38)
  at Bundle.generateChunks (node_modules/rollup/dist/es/shared/rollup.js:16083:40)
  at async Bundle.generate (node_modules/rollup/dist/es/shared/rollup.js:15960:28)
  at async eval (node_modules/rollup/dist/es/shared/rollup.js:23682:27)
  at async catchUnfinishedHookActions (node_modules/rollup/dist/es/shared/rollup.js:23041:20)
  at async Promise.all (index 0)
  at async Task.run (node_modules/rollup/dist/es/shared/watch.js:4958:32)
justindasilva commented 2 years ago

I have the same issue. Screen Shot 2022-05-06 at 3 14 06 PM

What I notice is that if I make a change to a file and save it, then the server works fine. But it seems to error out on first run. Any ideas?

johannschopplich commented 2 years ago

Same error here. Using pnpm.

vencho-mdp commented 2 years ago

this seems to be working now with the latest version of nitro. kind of weird

darklight9811 commented 2 years ago

@vencho-mdp this is still happening to me

vencho-mdp commented 2 years ago

@darklight9811 Hi! Do you have a reproduction?

darklight9811 commented 2 years ago

@vencho-mdp I believe it may be an issue with node version used, in my case:

My node version was 18.4.0

vencho-mdp commented 2 years ago

What happens if you set your node version to 16.x?

darklight9811 commented 2 years ago

@vencho-mdp 16.10.0 breaks, 16.13.1 works. Yeah, that makes sense since it says we need ^16.11.0, but it also says ^18 should work