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

YAMLException: unknown tag !<?> #5234

Closed
rasgo-cc opened this issue Aug 18, 2020 · 11 comments
Closed

YAMLException: unknown tag !<?> #5234

rasgo-cc opened this issue Aug 18, 2020 · 11 comments

Comments

@rasgo-cc
Copy link

rasgo-cc commented Aug 18, 2020

  • Version: 4.3.4
  • Electron Version: 9.2.0
  • Electron Type (current, beta, nightly): current
  • Target: win

Im getting this error when starting a packed app on Windows and I have no idea where to look for.
Screenshot: http://prntscr.com/u1hxpo

Unhandled Promise Rejection
YAMLException: unknown tag !<?> at line 1, column 9:
    provider: spaces
            ^

All yaml configurations look fine (local and the update ones sent to the provider - spaces). I'm using spaces from Digital Ocean and I'm using a JS file for configuration.

$ touch electron-builder.js

const dayjs = require("dayjs");

module.exports = {
  appId: "APPID",
  productName: "APP",
  buildVersion: dayjs().format("YYYYMMDD"),
  directories: {
    app: "./build/",
    output: "./dist/",
  },
  nsis: {
    oneClick: false,
    allowToChangeInstallationDirectory: true,
    installerIcon: "icon.ico",
    installerHeaderIcon: "icon.ico",
    artifactName: "${productName} Setup ${buildVersion}.${ext}",
  },
  publish: {
    provider: "spaces",
    region: "fra1",
    name: "asd",
    path: "app/v2/beta",
    channel: "beta",
  },
};

Same results when using a similar configuration (just without the buildVersion field), using the package.json.

app-update.yml is as follows:

provider: spaces
region: fra1
name: asd
path: /app/v2/beta
updaterCacheDirName: app-updater
publisherName:
  - MyOwnName

builder-effective-config.yaml

directories:
  output: ./dist/
  buildResources: build
  app: ./build/
appId: APPID
productName: APP
nsis:
  installerIcon: icon.ico
  installerHeaderIcon: icon.ico
  artifactName: '${productName} Setup ${buildVersion}.${ext}'
publish:
  provider: spaces
  region: fra1
  name: asd
  path: /app/v2/beta
electronVersion: 9.2.0

I'm using webpack to bundle my electron app, in case that matters.

Any ideas what might be happening?

@rasgo-cc
Copy link
Author

Not related with electron-updater but with webpack obfuscator plugin I'm using.

@JohnWeisz
Copy link

JohnWeisz commented Sep 7, 2020

@rasgo-cc
What was the cause of your issue specifically? I'm seeing the same problem.

It seems to be caused by webpack-obfuscator in my case too, and not enabling it for the main bundle (where the auto-updater code is implemented) solves the issue, although I'm unsure why.

@rasgo-cc
Copy link
Author

@JohnWeisz I ended up doing exactly the same, also not sure why that happens.

I also had some issues (if I can recall correctly, related with webpack external modules) when using this option on the obfuscator:
identifierNamesGenerator: "mangled" . Let me know if you share the same experience. I'll be investigating on this again soon.

@thisismydesign
Copy link

I'm seeing a similar issue. Did you manage to resolve it? Is there an issue to track on javascript-obfuscator?

@sanex3339
Copy link

sanex3339 commented Oct 25, 2020

Can anybody create a small minimal reproducible example (repository) with this bug? I'll try to investigate this problem.
Issue: javascript-obfuscator/javascript-obfuscator#790

@rasgo-cc
Copy link
Author

@sanex3339 thank you for your time! I noticed if I use webpack-obfuscator as a loader instead of a plugin I don't get this error. This way only my code gets obfuscated and not all the node modules the main process depends on. I'd assume this is expected behaviour but let me know if Im wrong.

@sanex3339
Copy link

I'm not sure that this is the expected behaviour. So i need a reproducible example

@rasgo-cc
Copy link
Author

rasgo-cc commented Oct 29, 2020

@sanex3339 planning to create a public repo that reproduces this by the end of this week / this weekend

@sanex3339
Copy link

Nice!

@rasgo-cc
Copy link
Author

rasgo-cc commented Nov 1, 2020

Interestingly, I can't reproduce the error with a much stripped down version of the code.
@sanex3339 here's the promised github repo: https://github.com/rasgo-cc/electron-updater-obfuscated

Using the webpack-obfuscator plugin, electron updater attempts to fetch an update from digital ocean spaces meaning it successfully reads the app-update.yml file. Not sure where to look at now. Any suggestion?

In the meantime, I just started using the loader so only my code is obfuscated. However, it would be nice to have the whole bundle obfuscated, if that's possible.

@sanex3339
Copy link

Ok, i'll check this. Let's continue here:
javascript-obfuscator/javascript-obfuscator#790

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

No branches or pull requests

4 participants