Heroku has problems with the devDependencies and can’t build the application:
-----> Pruning devDependencies
npm ERR! code ENOENT
npm ERR! syscall access
npm ERR! path node_modules/@vaadin/flow-deps
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, access 'node_modules/@vaadin/flow-deps'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.eO8Ea/_logs/2020-05-11T18_12_13_485Z-debug.log
-----> Build failed
This: “@vaadin/flow-deps”: “./target/frontend” seems to be the problem, because target folder isn’t pushed to git and therefore heroku doesn’t know the path.
Someone solved this or got an idea?
Vaadin 14.1 generates stuff into target/frontend when mvn vaadin:prepare-frontend is called. So the files should be generated properly on Heroku, when the build is run.
Sometimes the files just aren’t generated, or things are just missing randomly. In such case try doing the Vaadin Cleanup: delete node_modules, webpack*.js and package*.json files, build for production, then commit generated webpack.config.js and package*.js.
thank you for fast response. Here is further configuration:
Heroku-Settings:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- activate by setting the MAVEN_SETTINGS_PATH config var to heroku-settings.xml in Heroku project settings tab.
See https://devcenter.heroku.com/articles/using-a-custom-maven-settings-xml for more details.
-->
<activeProfiles>
<activeProfile>production</activeProfile>
<activeProfile>npm</activeProfile>
</activeProfiles>
</settings>
It’s solved - thank you! I have to delete the nodjs buildpack on heroku. Installed it a time ago and this seems to bring up trouble. Delete it and it works!