Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack template: index.css file missing when packaged #1030

Closed
just-paja opened this issue Jul 15, 2019 · 9 comments
Closed

Webpack template: index.css file missing when packaged #1030

just-paja opened this issue Jul 15, 2019 · 9 comments
Labels

Comments

@just-paja
Copy link

  • [✓] I have read the contribution documentation for this project.
  • [✓] I agree to follow the code of conduct that this project follows, as appropriate.
  • [✓] I have searched the issue tracker for an issue that matches the one I want to file, without success.

I updated to @electron-forge/plugin-webpack-6.0.0-beta.41 and build does not work anymore. It is reproducible just by trying this out on the webpack template. Steps to reproduce below. Everything runs without errors or warnings.

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

This is the package output:

WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:async-ora Process Started: Checking your system +0ms
  electron-forge:check-system checking system, create ~/.skip-forge-system-check to stop doing this +0ms
  electron-forge:async-ora Process Succeeded: Checking your system -- after 349ms +350ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:async-ora Process Started: Preparing to Package Application for arch: x64 +0ms
  electron-forge:project-resolver searching for project in: /var/tmp/my-new-app +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in /var/tmp/my-new-app/package.json +2ms
  electron-forge:require-search searching [ '@electron-forge/plugin-webpack',
  '/var/tmp/my-new-app/@electron-forge/plugin-webpack',
  '/var/tmp/my-new-app/node_modules/@electron-forge/plugin-webpack' ] relative to /var/tmp/my-new-app +0ms
  electron-forge:require-search testing @electron-forge/plugin-webpack +1ms
  electron-forge:plugin:webpack hooking process events +0ms
  electron-forge:async-ora Process Started: Compiling Main Process Code +389ms
  electron-forge:async-ora Process Succeeded: Compiling Main Process Code -- after 649ms +659ms
  electron-forge:async-ora Process Started: Compiling Renderer Template +0ms
  electron-forge:async-ora Process Succeeded: Compiling Renderer Template -- after 294ms +294ms
  electron-forge:packager packaging with options { asar: false,
  overwrite: true,
  ignore: [Function],
  dir: '/var/tmp/my-new-app',
  arch: 'x64',
  platform: 'linux',
  afterCopy: [ [Function] ],
  afterExtract: [ [Function] ],
  afterPrune: [ [Function] ],
  out: '/var/tmp/my-new-app/out',
  electronVersion: '5.0.6',
  quiet: true } +0ms
  electron-forge:async-ora Process Succeeded: Preparing to Package Application for arch: x64 -- after 2.8s +1s
  electron-forge:async-ora Process Started: Preparing native dependencies +1ms
  electron-forge:async-ora Process Succeeded: Preparing native dependencies -- after 4ms +4ms
  electron-forge:async-ora Process Started: Packaging Application +0ms
  electron-forge:async-ora Process Succeeded: Packaging Application -- after 187ms +187ms
  electron-forge:plugin:webpack handling process exit with: { cleanup: true } +3s

What does your config.forge data in package.json look like?

{
  "packagerConfig": {},
  "makers": [
    {
      "name": "@electron-forge/maker-squirrel",
      "config": {
        "name": "my_new_app"
      }
    },
    {
      "name": "@electron-forge/maker-zip",
      "platforms": [
        "darwin"
      ]
    },
    {
      "name": "@electron-forge/maker-deb",
      "config": {}
    },
    {
      "name": "@electron-forge/maker-rpm",
      "config": {}
    }
  ],
  "plugins": [
    [
      "@electron-forge/plugin-webpack",
      {
        "mainConfig": "./webpack.main.config.js",
        "renderer": {
          "config": "./webpack.renderer.config.js",
          "entryPoints": [
            {
              "html": "./src/index.html",
              "js": "./src/renderer.js",
              "name": "main_window"
            }
          ]
        }
      }
    ]
  ]
}

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.

npx create-electron-app my-new-app --template=webpack
cd my-new-app/
npm run package
./out/my-new-app-linux-x64/my-new-app

Snímek z 2019-07-15 16-40-50

@just-paja
Copy link
Author

just-paja commented Jul 15, 2019

I tried to solve this by downgrading:

  • 6.0.0.beta-40: The issue exists
  • 6.0.0.beta-39: It works ✓

@malept
Copy link
Member

malept commented Jul 15, 2019

@odahcam
Copy link

odahcam commented Jul 15, 2019

The issue still exists in beta 41 (as described on #1032):

{ 
    "@electron-forge/cli": "6.0.0-beta.41",
    "@electron-forge/maker-deb": "6.0.0-beta.41",
    "@electron-forge/maker-rpm": "6.0.0-beta.41",
    "@electron-forge/maker-squirrel": "6.0.0-beta.41",
    "@electron-forge/maker-zip": "6.0.0-beta.41",
    "@electron-forge/plugin-webpack": "6.0.0-beta.41",
}

Also, downgrading to beta 39 did not solve the issue, where the same happens.

The dependencies are the following:

  "dependencies": {
    "electron-squirrel-startup": "^1.0.0"
  },
  "devDependencies": {
    "@electron-forge/cli": "6.0.0-beta.39",
    "@electron-forge/maker-deb": "6.0.0-beta.39",
    "@electron-forge/maker-rpm": "6.0.0-beta.39",
    "@electron-forge/maker-squirrel": "6.0.0-beta.39",
    "@electron-forge/maker-zip": "6.0.0-beta.39",
    "@electron-forge/plugin-webpack": "6.0.0-beta.39",
    "@marshallofsound/webpack-asset-relocator-loader": "^0.5.0",
    "electron": "5.0.6",
    "file-loader": "^4.0.0",
    "node-loader": "^0.6.0",
    "style-loader": "^0.23.1"
  }

@malept
Copy link
Member

malept commented Jul 15, 2019

Beta 39 had the index.js issue but not the CSS file issue (as there was no CSS file).

Please be patient, I'm trying to release a new version as fast as possible.

@malept malept changed the title Webpack: Cannot find entry file Webpack template: index.css file missing when packaged Jul 15, 2019
@odahcam
Copy link

odahcam commented Jul 15, 2019

No worries, I just wanted to register that. I've already made a rewrite on my app so it can build without Webpack.

@malept
Copy link
Member

malept commented Jul 15, 2019

This has been fixed in beta 42.

@malept malept closed this as completed Jul 15, 2019
@malept malept added the bug label Jul 15, 2019
@just-paja
Copy link
Author

just-paja commented Jul 16, 2019

@malept, thank you for your work, I really did not expect this to be looked at so quickly.

I tried my initial approach this morning again with beta 42, but I'm still having the same trouble with index.js file, however, the index.css no longer appears in the console as 404, well, perhaps because there is no css in the initial example anymore. Could you please take a look again?

This is the reproduction steps:

npx create-electron-app my-new-app --template=webpack
cd my-new-app/
npm run package
./out/my-new-app-linux-x64/my-new-app

Snímek z 2019-07-16 11-05-53
Snímek z 2019-07-16 11-06-17

@rafael-trevisan
Copy link

Hi all,

Same problem here with index.js getting 404

Version: 6.0.0-beta.42

@malept
Copy link
Member

malept commented Jul 17, 2019

The index.js problem is confirmed and being tracked in #1034, please do not use this issue anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants