Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run dev problem when use iis and next-offline #222

Open
hmz22 opened this issue Feb 25, 2020 · 1 comment
Open

run dev problem when use iis and next-offline #222

hmz22 opened this issue Feb 25, 2020 · 1 comment

Comments

@hmz22
Copy link

hmz22 commented Feb 25, 2020

Hi Dears.
I have problem when run project in iis

this my next.config.js

const path = require("path");
const nextOffline = require("next-offline");

module.exports = nextOffline({
generateInDevMode:true,
workboxOpts: {
swDest: path.join(__dirname, "public/service-worker.js")
}
});

and have web.config when run give me this error:
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:10288) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:10288) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, open 'C:\projects\next-demo\node_modules\next-offline\register-sw-compiled.js'
(node:10288) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10288) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Can anyone help me?

@hmz22 hmz22 changed the title run dev problem when use iis Feb 25, 2020
@hmz22
Copy link
Author

hmz22 commented Feb 26, 2020

I solved this issue.
just need add this line to web.config:
I solved this issue just need add this line to your web.config

<configuration>
   <system.webServer>
    ...
     <iisnode node_env="production" />
     <httpErrors existingResponse="PassThrough" />
    ...
   </system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant