nklayman / vue-cli-plugin-electron-builder

Easily Build Your Vue.js App For Desktop With Electron
https://nklayman.github.io/vue-cli-plugin-electron-builder/
MIT License
4.12k stars 278 forks source link

Module parse failed: Unexpected character '#' #1924

Closed AutismPatient closed 1 year ago

AutismPatient commented 1 year ago

Describe the bug npm run electron:serve image

To Reproduce good running

Expected behavior

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

module.exports = {
    lintOnSave: false,
    devServer: {
        port: 8089
    },
    pluginOptions: {
        electronBuilder: {
            preload: 'src/preload.js',
            builderOptions: {
                publish: [
                    {
                        provider: "github",
                        releaseType: 'release',
                        private: true,
                    }
                ],
                win: {
                    target: ['zip'],
                    icon: 'build/WeHub.png',
                },
                extraResources: [
                    "script/check_db_export.bat",
                    "releases.md",
                    "script/bc4svn.bat",
                    'build/WeHub.png',
                    'build/icon.png'
                ],
                extraFiles: [
                    {
                        'from': 'golang',
                        'to': 'golang',
                        "filter": ["**/*"]
                    }
                ],
                afterAllArtifactBuild: './script/AfterAllArtifactBuild.js',
                afterPack: './script/BeforeAllArtifactBuild.js',
            },
            outputDir: 'electron-output'
        }
    }
}

Additional context

I used the node native module,But it seems to have failed

MatthijsBurgh commented 1 year ago

This is a problem with webpack and private class features in a 3rdparty library you use in your project. (https://github.com/npm/make-fetch-happen/blob/cd1ddb4aa73c44a082d3f1d6076b08534c6d9853/lib/pipeline.js#L6)

I can not help you much with this. Check the following to figure out the solution. https://github.com/webpack/webpack/issues/10216 https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/configuration.html#webpack-configuration https://webpack.js.org/loaders/babel-loader/ https://babeljs.io/docs/en/babel-plugin-proposal-class-properties

MatthijsBurgh commented 1 year ago

Probably similar, not the same, solution required as https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1833

AutismPatient commented 1 year ago

Thank you,brother.
DF73DAD4

AutismPatient commented 1 year ago

image

It doesn't seem to work ,I spent the whole day with no clue DFFB41EA

AutismPatient commented 1 year ago

After all, this problem points to an environment where C++ compilation is not configured correctly