Encountering an issue while trying to compile a basic example using Next JS + Nightmare Scraper. Upon attempting to access the page, I am faced with the following error message, and the page fails to load.
PS C:\Users\lucas\Documents\Projects\ProjectTest\pages\nightmare> npm run dev
[email protected] dev C:\Users\lucas\Documents\Projects\ProjectTest next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
event - compiled successfully
event - build page: / wait - compiling... error - ./node_modules/nightmare/lib/nightmare.js:17:0
Module not found: Can't resolve 'child_process' null
Could not find files for / in .next/build-manifest.json
Could not find files for / in .next/build-manifest.json
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
Switching to node ./index.js resolves the issue.
The identical error appears when using either nightmare or puppeteer.
index.js
const test = require('nightmare');
function Page() {
return <div>Test 2</div>
}
export default Page
package.json
{
"name": "Test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "next dev"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"nightmare": "^3.0.2",
"next": "^10.0.6",
"puppeteer": "^7.1.0",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {}
}