nitro icon indicating copy to clipboard operation
nitro copied to clipboard

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

Open vencho-mdp opened this issue 2 years ago • 8 comments

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)

vencho-mdp avatar May 05 '22 22:05 vencho-mdp

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?

justindasilva avatar May 06 '22 19:05 justindasilva

Same error here. Using pnpm.

johannschopplich avatar May 11 '22 06:05 johannschopplich

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

vencho-mdp avatar May 23 '22 19:05 vencho-mdp

@vencho-mdp this is still happening to me

darklight9811 avatar Jun 20 '22 03:06 darklight9811

@darklight9811 Hi! Do you have a reproduction?

vencho-mdp avatar Jun 20 '22 13:06 vencho-mdp

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

  • create routes/index.ts exporting export default () => "hi"
  • yarn init
  • yarn add nitropack
  • add a script to run nitropack
  • run it

My node version was 18.4.0

darklight9811 avatar Jun 20 '22 13:06 darklight9811

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

vencho-mdp avatar Jun 20 '22 13:06 vencho-mdp

@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

darklight9811 avatar Jun 20 '22 13:06 darklight9811