Issue 1:
I have a question, and I can't manage to find the answer in the docs.

I would like to get the HTML the server is going to render on a route so I can connect it to a service that turns that HTML into a PDF, in order to server side render pages as PDF.

Can someone shed any light on where I could plug in this? Im playing around in server.js but I cant manage to get the HTML..

The idea is as follows:

1.- You enter in /document/:id/pdf/ route

2.- The HTML string is processed by a HTML to PDF script on the server (or possibly is sent to an external service)

3.- The server renders the page and serves the PDF document file to the user.

Any info is greatly appreciated. Thanks.

I have searched the issues of this repository and believe that this is not a duplicate.

Issue 2:
pnpm is an alternative package manager.

I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Should work.

Current Behavior

npm run build

> vwp@1.0.0 build /Users/Vaughan/dev-live/vwp
> next build

> Failed to build on /var/folders/kp/06ys69nn6hq9k23cv0xxn19m0000gn/T/f445f6d8-80e8-4d8d-8946-d62056f4ddb7
{ Error: ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry
Module not found: Error: Can't resolve '../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js' in '/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages'
resolve '../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js' in '/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages'
using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)
using description file: /Users/Vaughan/dev-live/vwp/package.json (relative path: ./.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.json doesn't exist
as directory
/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js doesn't exist
[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js]
[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.js]
[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.json]
[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js]
@ ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry 3:17-118
@ multi ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry
at /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/build/index.js:182:21
at emitRecords.err (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:269:13)
at Compiler.emitRecords (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:375:38)
at emitAssets.err (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:368:12)
at next (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/tapable/0.2.8/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/tapable/0.2.8/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:365:9)
at require.forEach.err (/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/webpack/3.3.0/node_modules/webpack/lib/Compiler.js:360:15)
errors:
[ './node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry\nModule not found: Error: Can\'t resolve \'../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js\' in \'/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages\'\nresolve \'../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js\' in \'/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages\'\n using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)\n Field \'browser\' doesn\'t contain a valid alias configuration\n after using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)\n using description file: /Users/Vaughan/dev-live/vwp/package.json (relative path: ./.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js)\n no extension\n Field \'browser\' doesn\'t contain a valid alias configuration\n /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js doesn\'t exist\n .js\n Field \'browser\' doesn\'t contain a valid alias configuration\n /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.js doesn\'t exist\n .json\n Field \'browser\' doesn\'t contain a valid alias configuration\n /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.json doesn\'t exist\n as directory\n /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js doesn\'t exist\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.js]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js.json]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/lib/error.js]\n @ ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry 3:17-118\n @ multi ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_error.js?entry',
'./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_document.js?entry\nModule not found: Error: Can\'t resolve \'../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js\' in \'/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages\'\nresolve \'../../../../../../../../.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js\' in \'/Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages\'\n using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)\n Field \'browser\' doesn\'t contain a valid alias configuration\n after using description file: /Users/Vaughan/dev-live/vwp/node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/package.json (relative path: ./dist/pages)\n using description file: /Users/Vaughan/dev-live/vwp/package.json (relative path: ./.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js)\n no extension\n Field \'browser\' doesn\'t contain a valid alias configuration\n /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js doesn\'t exist\n .js\n Field \'browser\' doesn\'t contain a valid alias configuration\n /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js.js doesn\'t exist\n .json\n Field \'browser\' doesn\'t contain a valid alias configuration\n /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js.json doesn\'t exist\n as directory\n /Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js doesn\'t exist\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js.js]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js.json]\n[/Users/Vaughan/dev-live/vwp/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/server/document.js]\n @ ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_document.js?entry 3:17-124\n @ multi ./node_modules/.registry.npmjs.org/next/3.0.6/node_modules/next/dist/pages/_document.js?entry' ],
warnings: [] }

Steps to Reproduce (for bugs)

mkdir foo && cd foo

npm init -y

pnpm i react react-dom next

npm run build

Context

Your Environment

Tech
Version

next
3.0.6

node
8.1.2

OS
macOS

browser

etc