Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

importing webpack causes fatal exception #210

@aeneasr

Description

@aeneasr

I used electron-compile a while ago but since electron-builder didn't support it, I had a toolchain that first transpiled JSX using babel and then ran electron from the directory where the transpiled files where at. Now that electron-builder finally supports electron-compile, I wanted to switch back. Unfortunately, using electron-prebuilt-compile, I was unable to start the project as I received this error:

App threw an error during load
C:\workspace\js\sites-app\node_modules\webpack\lib\WebpackOptionsApply.js:209
                        comment = legacy && modern ? "\n/*\n//@ sourceMappingURL=[url]\n//# sourceMappingURL=node_modules\webpack\lib\[url]\n*\" :
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
    at Object.exports.runInThisContext (vm.js:78:16)
    at Module._compile (module.js:543:28)
    at Object.require.extensions.(anonymous function) [as .js] (C:\workspace\js\sites-app\node_modules\electron-compile\lib\require-hook.js:75:14)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\workspace\js\sites-app\node_modules\webpack\lib\webpack.js:10:29)
    at Object.<anonymous> (C:\workspace\js\sites-app\node_modules\webpack\lib\webpack.js:121:3)
    at Module._compile (module.js:571:32)
    at Object.require.extensions.(anonymous function) [as .js] (C:\workspace\js\sites-app\node_modules\electron-compile\lib\require-hook.js:75:14)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)

I'm actually importing webpack in my app

import React from 'react'
import webpack from 'webpack'

primarily because I want to build third party code using the electron-app and webpack. When I remove the webpack dependency, the app compiles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions