Windows Server 2022 Datacenter = IIS Server
Hej
Jag arbetar med en hemsida Next JS och ska lägga den på en IIS server. Jag har utgått från artikeln Deploying NextJs Application on Window’s IIS Server
När jag gjort allt jag ska och byggt min applikation med Yarn build med output mappen ".next". Sparat den på server och får nedanstående fel:
iisnode encountered an error when processing the request.
HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.
In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.
The last 64k of the output generated by the node.exe process to stderr is shown below:
(node:7388) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Application has thrown an uncaught exception and is terminated:
Error: Cannot find module '@material-ui/core/styles'
Require stack:
- C:\inetpub\wwwroot\Statistik\.next\server\pages\_app.js
- C:\inetpub\wwwroot\Statistik\node_modules\next\dist\server\require.js
- C:\inetpub\wwwroot\Statistik\node_modules\next\dist\server\next-server.js
- C:\inetpub\wwwroot\Statistik\node_modules\next\dist\server\next.js
- C:\inetpub\wwwroot\Statistik\server.js
- C:\Program Files\iisnode\interceptor.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at C:\inetpub\wwwroot\Statistik\node_modules\next\dist\server\require-hook.js:189:36
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:110:18)
at 8308 (C:\inetpub\wwwroot\Statistik\.next\server\pages\_app.js:89:18)
at __webpack_require__ (C:\inetpub\wwwroot\Statistik\.next\server\webpack-runtime.js:25:42)
at C:\inetpub\wwwroot\Statistik\.next\server\chunks\178.js:247:82
at __webpack_require__.a (C:\inetpub\wwwroot\Statistik\.next\server\webpack-runtime.js:89:13)
at 2391 (C:\inetpub\wwwroot\Statistik\.next\server\chunks\178.js:240:21)
Ni får givetvis det ni behöver för att hjälpa
Mvh Fredrik
Computer: Windows 11, 64-bit, Intel 285k, MSI MEG Z890 Ace, 64GB RAM,
MSI GeForce RTX 5080 16GB Vanguard SOC Launch