nitro
nitro copied to clipboard
webtorrent breaks rollup build in dev mode
Environment
nitropack: 0.4.4 node: 16.13.2 no config
Reproduction
- create a new project
- install webtorrent
- add this code:
import WebTorrent from "webtorrent";
const client = new WebTorrent();
export default () => "Hello World";
- npx nitropack dev
Describe the bug
Rollup errors, the server doesn't run.
All is fine and webtorrent works as expected with npx nitropack build
and node .output/server/index.mjs
Additional context
No response
Logs
No response
Possible duplicate of https://github.com/unjs/nitro/issues/200?
Same with @prisma/client
. nitropack: 0.4.4
import { PrismaClient } from "@prisma/client";
const client = new PrismaClient();
export default () => ''
Rollup error: Cannot read properties of null (reading 'included') nitro 17:33:41
at Module.isIncluded (/C:/Users/kozac/Dev/temp-projects/nitro-app/node_modules/rollup/dist/es/shared/rollup.js:12671:25)
at /C:/Users/kozac/Dev/temp-projects/nitro-app/node_modules/rollup/dist/es/shared/rollup.js:16144:17
at Array.filter (<anonymous>)
at getIncludedModules (/C:/Users/kozac/Dev/temp-projects/nitro-app/node_modules/rollup/dist/es/shared/rollup.js:16143:38)
at Bundle.generateChunks (/C:/Users/kozac/Dev/temp-projects/nitro-app/node_modules/rollup/dist/es/shared/rollup.js:16089:40)
at async Bundle.generate (/C:/Users/kozac/Dev/temp-projects/nitro-app/node_modules/rollup/dist/es/shared/rollup.js:15966:28)
at async /C:/Users/kozac/Dev/temp-projects/nitro-app/node_modules/rollup/dist/es/shared/rollup.js:23694:27
at async catchUnfinishedHookActions (/C:/Users/kozac/Dev/temp-projects/nitro-app/node_modules/rollup/dist/es/shared/rollup.js:23053:20)
at async Promise.all (index 0)
at async Task.run (/C:/Users/kozac/Dev/temp-projects/nitro-app/node_modules/rollup/dist/es/shared/watch.js:4942:32)
Upd This was bypassed by add package to external:
export default defineNitroConfig({
rollupConfig: {
external: [
'@prisma/client'
]
}
})
Closing since the issue has been stalled for a long period. If experiencing issues with latest version of nitro, please feel free to open a new issue with a fresh reproduction 🙏🏼