I am experiencing difficulties deploying my Next.js v13 application on a Windows Server running IIS. After deployment, I encounter a syntax error that prevents the application from running properly. Specifically, I cannot locate main-app.js in the /next folder as expected. Here are the details of the issue:
Error Description: After deploying my Next.js v13 application on a Windows Server with IIS, I encounter a syntax error. The error message indicates a problem with the JavaScript syntax, but I cannot locate main-app.js in the /next folder where it’s typically found. This is hindering my ability to pinpoint and fix the issue.
Deployment Environment: I am deploying on a Windows Server running IIS. I have followed the standard deployment procedures for Next.js applications, including building the project (npm run build) and configuring IIS to serve the application.
Next.js Version: I am using Next.js v13.5.4.
Error Code:
line 28. eval(webpack_require_.ts(“n/**n* MIT License n n Copyright (c) Facebook, Inc. and its affiliates. n n* Permission is hereby granted, free of charge, to any person obtaining a copyn* of this software and associated documentation files (the “Software”), to dealn* in the Software without restriction, including without limitation the rights n* to use, copy, modify, merge, publish, distribute, sublicense, and/or selln* copies of the Software, and to permit persons to whom the Software isn* furnished to do so, subject to the following conditions: n n The above copyright notice and this permission notice shall be included in alln copies or substantial portions of the Software. n n THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS ORn IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERn* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE n* SOFTWARE. n /nvar _importDefault (this && this.__importDefault) || function (mod) {n return (mod && mod._esModule) ? mod: {“default”: mod };n}; nObject.define Property (exports, “_esModule”, ({ value: true }));n// This file is copied from the Metro JavaScript bundler, with minor tweaks for n// webpack 4 compatibility. n//n// https://github.com/facebook/metro/blob/d6b9685c730d0d63577db40f41369157f28dfa3a/packages/metro/src/lib/polyfills/require.js nconst runtime_1 = _importDefault(webpack_require(/! next/dist/compiled/react-refresh/runtime */”(app-pages-browser) /./node_modules/next/dist/compiled/react-refresh/runtime.js”));nfunction isSafeExport (key) {n return (key === ‘_esModule’ || n // TODO: remove this key from page config instead of allow listing itn ===
Expectations: I am seeking guidance on how to resolve this syntax error and locate main-app.js or understand where the issue might be originating from in the deployment process on a Windows environment.
If anyone has encountered similar issues deploying Next.js applications on Windows Servers with IIS or has insights into how to debug and resolve syntax errors in this context, I would greatly appreciate your assistance. Thank you!
Hammad Azam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.