FAQ

Front-end build FAQ

sass-loader

Reference: https://www.jianshu.com/p/24f98f66c6ba

Deployment scenario issues

Deploy to nginx access 400

Reason 1: There are too many back-end configuration permissions, exceeding the default maximum value of nginx configuration Solution: Modify nginx configuration

http { client_header_buffer_size 64k; #default value 1k large_client_header_buffers 4 64k; #Default value 4 8k }

Deployment to iis PUT, POST and other requests failed 405 exception

An HTTP Error 405.0 - Method Not Allowed error occurred when requesting the Put/POST/DELETE operation of the REST service deployed on IIS7.5.

Remove from HttpModule IIS rejects PUT and DELETE requests because IIS registers a custom HttpModule named WebDAVModule for the website by default. If our site does not need to provide support for WebDAV, so IIS7 closes the WebDAV extension service. The direct way is to use the following configuration to remove the registered HttpModule:

<system. webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
</system. webServer>

Remove the WebDAV module Find the WebDAVModule from the module and remove it

Deploying to the iis interface cannot be accessed

TODO stay tuned

About how the system releases some interfaces

TODO stay tuned

Start project sqlsugar report error

Question: An exception of type "SqlSugar.SqlSugarException" occurred in SqlSugar.dll, but it was not handled in user code Please Google the error message first

Please check if the string concatenation is correct

Disable running scripts

Error text: npm: Could not load file D:\nodejs\node_global\npm.ps1 because running scripts is prohibited on this system.

Because it is forbidden to run scripts on this system, that is to say, there is no permission, take a look:

d:> get-ExecutionPolicy Restricted Restricted means that the status is prohibited, then give permission: Set-ExecutionPolicy -Scope CurrentUser Input: RemoteSigned

Error executing SQL

Example: Invalid column name 'CoverUrl'. Generally, this error will be prompted when the database field is updated, just add the corresponding field to the database table.

Packing

If the deployment of iis cannot be accessed, there are two ways:

  1. Backend packaging: in the VS2022 menu (Generate\Release)
  2. Open the La.WebApi.exe file directly and see the error log of the console
  3. There is a false in web.config and changed to true. After restarting the project and running the website in iis, there is a folder log under the directory with error log files
  4. If you have the environment, please use Laplace_deb.sql, sql2019 version to import directly. If you have no environment, you can use the SQLite version, laplace.net.db, and configure it in
  5. Front-end packaging: npm run build:prod
✓ built in 2m 20s

Overflow solution

   FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
delete command
    rimraf node_modules
1. Install dependencies
    npm i
2. Increase the memory mechanism
    npm install -g increase-memory-limit
3. Execution
     increase-memory-limit
4. Modify the node_modules\.bin\webpack.cmd file, search for "%_prog%" globally and replace it with %_prog%

5. Modify package.js
      "scripts": {
     "dev": "vite",
     "build:prod": "vite build",
     "build:stage": "vite build --mode staging",
     "preview": "vite preview"
   },
changed to
      "scripts": {
     "dev": "node.exe --max-old-space-size=10240 node_modules/vite/bin/vite.js",
     "build:prod": "node.exe --max-old-space-size=10240 node_modules/vite/bin/vite.js build",
     "build:stage": "vite build --mode staging",
     "preview": "vite preview"
   },
6. ReBuild
    npm run build:prod