Fix: npx webpack make: *** [Makefile:699: public/js/index.js] Error -… #15465

Merged
Run2948 merged 3 commits from master into master 2021-04-15 20:07:31 +00:00
Run2948 commented 2021-04-14 05:43:53 +00:00 (Migrated from github.com)

when I execute TAGS="bindata" make build to build gitea, it shows:
npx webpack make: *** [Makefile:699: public/js/index.js] Error -1073741819

$ webpack -v
webpack 5.11.1
webpack-cli 4.3.1

$ TAGS="bindata" make build
rm -rf public/js public/css public/fonts public/img/webpack public/serviceworker.js
npx webpack
[webpack-cli] Failed to load 'E:\C_Language\Workspaces\GoProjects\gitea\webpack.config.js' config
[webpack-cli] file:///E:/C_Language/Workspaces/GoProjects/gitea/webpack.config.js:9
import {VueLoaderPlugin} from 'vue-loader';
        ^^^^^^^^^^^^^^^
SyntaxError: The requested module 'vue-loader' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from 'vue-loader';
const {VueLoaderPlugin} = pkg;
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:137:5)
    at async Loader.import (internal/modules/esm/loader.js:165:24)
    at async loadConfig (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1346:35)
    at async WebpackCLI.resolveConfig (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1454:38)
    at async WebpackCLI.createCompiler (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1839:22)
    at async WebpackCLI.buildCommand (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1954:20)
    at async Command.<anonymous> (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:735:25)
    at async Promise.all (index 1)
    at async Command.<anonymous> (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1284:13)
make: *** [Makefile:699: public/js/index.js] Error 2
when I execute `TAGS="bindata" make build` to build gitea, it shows: **npx webpack make: *** [Makefile:699: public/js/index.js] Error -1073741819** ```bash $ webpack -v webpack 5.11.1 webpack-cli 4.3.1 $ TAGS="bindata" make build rm -rf public/js public/css public/fonts public/img/webpack public/serviceworker.js npx webpack [webpack-cli] Failed to load 'E:\C_Language\Workspaces\GoProjects\gitea\webpack.config.js' config [webpack-cli] file:///E:/C_Language/Workspaces/GoProjects/gitea/webpack.config.js:9 import {VueLoaderPlugin} from 'vue-loader'; ^^^^^^^^^^^^^^^ SyntaxError: The requested module 'vue-loader' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export. For example: import pkg from 'vue-loader'; const {VueLoaderPlugin} = pkg; at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21) at async ModuleJob.run (internal/modules/esm/module_job.js:137:5) at async Loader.import (internal/modules/esm/loader.js:165:24) at async loadConfig (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1346:35) at async WebpackCLI.resolveConfig (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1454:38) at async WebpackCLI.createCompiler (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1839:22) at async WebpackCLI.buildCommand (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1954:20) at async Command.<anonymous> (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:735:25) at async Promise.all (index 1) at async Command.<anonymous> (E:\C_Language\Workspaces\GoProjects\gitea\node_modules\webpack-cli\lib\webpack-cli.js:1284:13) make: *** [Makefile:699: public/js/index.js] Error 2 ```
silverwind (Migrated from github.com) reviewed 2021-04-14 11:59:04 +00:00
silverwind (Migrated from github.com) commented 2021-04-14 11:59:03 +00:00
const {VueLoaderPlugin} = VueLoader;
const {ESBuildMinifyPlugin} = EsBuildLoader;
const {SourceMapDevToolPlugin} = webpack;
const __dirname = dirname(fileURLToPath(import.meta.url));

re-order just for the looks

```suggestion const {VueLoaderPlugin} = VueLoader; const {ESBuildMinifyPlugin} = EsBuildLoader; const {SourceMapDevToolPlugin} = webpack; const __dirname = dirname(fileURLToPath(import.meta.url)); ``` re-order just for the looks
silverwind (Migrated from github.com) approved these changes 2021-04-15 18:53:26 +00:00
zeripath approved these changes 2021-04-15 18:54:56 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#15465
No description provided.