adobe/cryptr

Unable to build Cryptr from Source(Master) on Windows 10 but works in Ubuntu 18.04.

abkhande opened this issue · 1 comments

The problem

Unable to build Cryptr from Source(Master) on Windows 10 but works in Ubuntu 18.04.

Environment

  • Cryptr 0.4.0 or Master whichever is latest.
  • Desktop OS/version used to run Cryptr: Windows 10/ Ubuntu 18.04
  • Vault version: Vault v1.6.0

Details

node version - v15.8.0
npm version - 7.5.1

I tried to build the source code from master branch in Windows and Ubuntu and used the above version to install its dependencies. Here are the steps -

  1. git clone https://github.com/jcrowthe/cryptr.git
  2. cd cryptr
  3. npm install
  4. npm run dev
    You will get 56 odd errors, a majority would be -
    "Uncaught ReferenceError: Polymer is not defined"
    "Failed to load resource: net::ERR_FILE_NOT_FOUND" (..../cryptr/app/bower_components/app-storage/app-localstorage/some.html)

So the above issues are resolved when you install bower and its dependencies and add fuse.js and granite-html.

and then when I tried to run "npm run dev" again I got below error and blank screen with no UI-

iron-selectable.html:301 Uncaught TypeError: Cannot read property 'NaN' of undefined
at HTMLElement._valueToItem (iron-selectable.html:301)
at HTMLElement._selectSelected (iron-selectable.html:288)
at HTMLElement._updateSelected (iron-selectable.html:284)
at HTMLElement._complexObserverEffect (polymer.html:1640)
at HTMLElement._effectEffects (polymer.html:1475)
at HTMLElement._propertySetter (polymer.html:1459)
at HTMLTemplateElement.__setProperty (polymer.html:1468)
at HTMLTemplateElement._applyEffectValue (polymer.html:1951)
at HTMLTemplateElement._annotationEffect (polymer.html:1614)
at HTMLTemplateElement._effectEffects (polymer.html:1475)

Now I don't see a way to resolve this one in windows but in ubuntu, if you replace this file with
https://raw.githubusercontent.com/Polymer/polymer-modulizer/master/fixtures/packages/paper-button/source/bower_components/iron-selector/iron-selectable.html

the error will go away.

Since I am using the same steps/dependency manager version in Linux & windows. I am not sure what's different in windows.

If I tried to replace this file in windows with the above as mentioned I got a separate error -
iron-menu-behavior.html:230 Uncaught TypeError: item.setAttribute is not a function
at HTMLElement._applySelection (iron-menu-behavior.html:230)
at Polymer.IronSelection.setItemSelected (iron-selection.html:84)
at Polymer.IronSelection.select (iron-selection.html:103)
at HTMLElement._selectSelected (iron-selectable.html:288)
at HTMLElement._updateSelected (iron-multi-selectable.html:96)
at HTMLElement._complexObserverEffect (polymer.html:1640)
at HTMLElement._effectEffects (polymer.html:1475)
at HTMLElement._propertySetter (polymer.html:1459)
at HTMLElement.__setProperty (polymer.html:1468)
at HTMLElement._applyConfig (polymer.html:2081)

Hence I thought, since it is working in ubuntu I can actually build the app using the docker run command as mentioned in RELEASING.md docs in Linux and build executable for Windows 10 & Ubuntu from Linux. This way I don;t have to worry fixing the above error mentioned. Unfortunately, the executable produced(Cryptr Setup 0.4.0.exe) is not working for Windows 10. But Cryptr-0.4.0.AppImage works in Ubuntu without any issues.

This is the error I got after I successfully logged on to our Vault server using LDAP mechanism.

USER

  • New
    my-user

So when I click on either of the above choices it says...

Can't find file:////C:/Users/abkhande/AppData/Local/Programs/cryptr/resources/app.sasr/index.html#!/. Redirected to Home Page OK.

Conclusion: It would be great if I am able to build it for windows by fixing any of the issues I mentioned above. Thanks.

Steps to Reproduce

  1. Edit package.json
    "dist": "electron-builder -wl --x64"
  2. $ docker run --rm -ti
    --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_')
    --env ELECTRON_CACHE="/root/.cache/electron"
    --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder"
    -v ${PWD}:/project
    -v ${PWD##*/}-node-modules:/project/node_modules
    -v ~/.cache/electron:/root/.cache/electron
    -v ~/.cache/electron-builder:/root/.cache/electron-builder
    electronuserland/builder:wine

$ yarn dist

I am able to figure it out by downloading a specific version of iron-selectable.