When I deploy to heroku I get this error during "npm install": ``` E

When I deploy to heroku I get this error during “npm install”:

       ERROR in ../node_modules/@vaadin/flow-frontend/vaadin-zxing-reader.js?babel-target=es5
       Module not found: Error: Can't resolve '@zxing/library?babel-target=es5' in '/tmp/build_54af9e74_/gui/node_modules/@vaadin/flow-frontend'
        @ ../node_modules/@vaadin/flow-frontend/vaadin-zxing-reader.js?babel-target=es5 16:0-40 30:27-57
        @ ../target/frontend/generated-flow-imports.js?babel-target=es5
       
       ERROR in ../node_modules/@vaadin/flow-frontend/vaadin-zxing-writer.js?babel-target=es5
       Module not found: Error: Can't resolve '@zxing/library?babel-target=es5' in '/tmp/build_54af9e74_/gui/node_modules/@vaadin/flow-frontend'
        @ ../node_modules/@vaadin/flow-frontend/vaadin-zxing-writer.js?babel-target=es5 13:0-40 37:27-55
        @ ../target/frontend/generated-flow-imports-fallback.js
        @ ../target/frontend/generated-flow-imports.js?babel-target=es5
       
       ERROR in ../node_modules/@vaadin/flow-frontend/vaadin-zxing-reader.js?babel-target=es6
       Module not found: Error: Can't resolve '@zxing/library?babel-target=es6' in '/tmp/build_54af9e74_/gui/node_modules/@vaadin/flow-frontend'
        @ ../node_modules/@vaadin/flow-frontend/vaadin-zxing-reader.js?babel-target=es6 2:0-40 8:26-56
        @ ../target/frontend/generated-flow-imports.js?babel-target=es6
       
       ERROR in ../node_modules/@vaadin/flow-frontend/vaadin-zxing-writer.js?babel-target=es6
       Module not found: Error: Can't resolve '@zxing/library?babel-target=es6' in '/tmp/build_54af9e74_/gui/node_modules/@vaadin/flow-frontend'
        @ ../node_modules/@vaadin/flow-frontend/vaadin-zxing-writer.js?babel-target=es6 2:0-40 20:25-53
        @ ../target/frontend/generated-flow-imports-fallback.js
        @ ../target/frontend/generated-flow-imports.js?babel-target=es6
       
       ERROR in chunk bundle [entry]

       build/vaadin-bundle-dc3108f3905557bb3cfc.cache.js
       /tmp/build_54af9e74_/gui/node_modules/babel-loader/lib/index.js??ref--4-0!/tmp/build_54af9e74_/gui/target/frontend/generated-flow-imports.js?babel-target=es6 b734354eb7ff37430d04704bb6122f1b
       Unexpected token (9:26)
       |     super();
       |     this.excludes = ['NotFoundException', 'ChecksumException', 'FormatException']
;
       |     this.codeReader = new !(function webpackMissingModule() { var e = new Error("Cannot find module '@zxing/library?babel-target=es6'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())();
       |   }
       | 
       
       ERROR in chunk bundle.es5 [entry]

       build/vaadin-bundle.es5-8bd81259f4730bc274a0.cache.js
       /tmp/build_54af9e74_/gui/node_modules/babel-loader/lib/index.js??ref--4-0!/tmp/build_54af9e74_/gui/target/frontend/generated-flow-imports.js?babel-target=es5 c4ccb30e8fefc82abc6cf841bdf32163
       Unexpected token (31:27)
       |     _this = _super.call(this);
       |     _this.excludes = ['NotFoundException', 'ChecksumException', 'FormatException']
;
       |     _this.codeReader = new !(function webpackMissingModule() { var e = new Error("Cannot find module '@zxing/library?babel-target=es5'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())();
       |     return _this;
       |   }
       
       ERROR in build/vaadin-3-7502f96482d3077675db.cache.js from Terser
       Unexpected token: operator (!) [build/vaadin-3-7502f96482d3077675db.cache.js:45973,27]

       
       ERROR in build/vaadin-4-5b948b502f01ca2a06f1.cache.js from Terser
       Unexpected token: operator (!) [build/vaadin-4-5b948b502f01ca2a06f1.cache.js:45846,25]

Log says Module not found: Error: Can't resolve @zxing/library
So before you build and package your application to be deployed to heroku. Run the command:

npm install @zxing/library

Just deployed the demo to heroku.

https://zxing-vaadin.herokuapp.com/

Thanks for the fast reply, Ryan.
On my local machine this indeed works, but not on heroku.
How did you deploy? I am using automatic deploys from my github repo, so heroku is pulling my code, building and deploying it. It feels like I should include something in my repo to make sure heroku also executes this command.
If you have another way of deploying, I would be happy to use that as a workaround.
Thanks in advance!

I used Heroku CLI. Followed this [instructions]
(https://ramonak.io/posts/how-to-deploy-vaadin-14-app-to-heroku).

mvn clean package -Pproduction heroku:deploy

Strangely enough the “heroku deploy:jar” command did not work, but using the maven heroku plugin it did.
Now it’s deployed and working, so thanks a lot!