strapi-plugin-content-export-import
strapi-plugin-content-export-import copied to clipboard
Deploy with Heroku
I have the following error when trying to deploy with Heroku. What I forget?
Error: Module not found: Error: Can't resolve 'file-saver' in '/tmp/build_5841cb02_/plugins/content-export-import/admin/src/containers/ExportPage'
I guess you need to run yarn install
in the plugin folder.
file-saver
is a dependency of this plugin.
Already done 😔
how did you do that? i tried through ssh but i couldn't do that, can you help me @arnaudjnn ?
@arnaudjnn I don't know if you could solve it but I did in the following way:
- I added this plugin as a git submodule to make Heroku to clone it before to build the project:
cd plugins && git submodule add https://github.com/lazurey/strapi-plugin-content-export-import.git plugins/content-export-import
- I added the library dependencies from the plugin to the project:
"file-saver": "^2.0.2",
"pluralize": "^8.0.0",
"strapi-helper-plugin": "^3.2.5"
- I installed it locally in order to update the
yarn.lock
package. - Finally, I made a commit and I pushed it directly to Heroku.
That's enough.
@SalahAdDin thanks for sharing your solution. Just to verify your process:
1, create plugins
directory
2, cd plugins
3, git submodule add https://github.com/lazurey/strapi-plugin-content-export-import.git plugins/content-export-import
4, install those three dependencies at the root level
5 deploy to Heroku
Correct?
@SalahAdDin I tried and the folder structure looks like this, but after deployment, this plugin is still unavailable with Heroku. Anything wrong? Thanks!!
Did you try to re deploy it? I solved adding it as submodule; after deploying to heroku
, it pulls the submodule itself and installs it.
@SalahAdDin I set up the auto-deploy with Heroku, so technically after pushing to Github, it will redeploy. Here is my repo https://github.com/chloesun/ESDB_strapi, looks right to you? I still don't see that plugin installed in the production...
Try deployin it manually, your repository looks like mine, so, it is correct.
@SalahAdDin thanks for your speedy reply, I even restart an app with Heroku, and manually deploy it, but still not showing this plugin.....
It is not normal, check when you deploy, and look the Heroku documentation as well.
@SalahAdDin Here is the build log of Heroku
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
USE_YARN_CACHE=true
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): >=10.16.0 <=14.x.x
engines.npm (package.json): >=6.0.0
engines.yarn (package.json): unspecified (use default)
Resolving node version >=10.16.0 <=14.x.x...
Downloading and installing node 14.17.0...
Bootstrapping npm >=6.0.0 (replacing 6.14.13)...
npm >=6.0.0 installed
Resolving yarn version 1.22.x...
Downloading and installing yarn (1.22.10)
Installed yarn 1.22.10
-----> Restoring cache
- yarn cache
-----> Installing dependencies
Installing node modules (yarn.lock)
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "strapi-admin > [email protected]" has unmet peer dependency "[email protected] - 3".
warning "strapi-admin > [email protected]" has unmet peer dependency "popper.js@^1.16.1".
warning " > [email protected]" has incorrect peer dependency "[email protected]".
warning "strapi-plugin-graphql > [email protected]" has incorrect peer dependency "graphql@^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "strapi-plugin-graphql > [email protected]" has unmet peer dependency "koa@^2".
warning "strapi-plugin-graphql > [email protected]" has incorrect peer dependency "graphql@^0.9.1 || ^0.10.0 || ^0.12.0 || ^0.13.0".
warning "strapi-plugin-users-permissions > [email protected]" has unmet peer dependency "koa@>=2.0.0".
[4/4] Building fresh packages...
Done in 43.15s.
-----> Build
Running build (yarn)
yarn run v1.22.10
$ strapi build
Building your admin UI with production configuration ...
ℹ Compiling Webpack
✔ Webpack: Compiled successfully in 1.75m
Done in 108.23s.
-----> Pruning devDependencies
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "strapi-admin > [email protected]" has unmet peer dependency "[email protected] - 3".
warning "strapi-admin > [email protected]" has unmet peer dependency "popper.js@^1.16.1".
warning " > [email protected]" has incorrect peer dependency "[email protected]".
warning "strapi-plugin-graphql > [email protected]" has incorrect peer dependency "graphql@^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "strapi-plugin-graphql > [email protected]" has unmet peer dependency "koa@^2".
warning "strapi-plugin-graphql > [email protected]" has incorrect peer dependency "graphql@^0.9.1 || ^0.10.0 || ^0.12.0 || ^0.13.0".
warning "strapi-plugin-users-permissions > [email protected]" has unmet peer dependency "koa@>=2.0.0".
[4/4] Building fresh packages...
warning Ignored scripts due to flag.
Done in 14.36s.
-----> Caching build
- yarn cache
-----> Build succeeded!
! Unmet dependencies don't fail yarn install but may cause runtime issues
https://github.com/npm/npm/issues/7494
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 141.7M
-----> Launching...
Released v14
https://esdb-backend.herokuapp.com/ deployed to Heroku
It is missing your change on the repository, what it does is the same on local: it pulls the repository code before to build the admin panel: https://devcenter.heroku.com/articles/git-submodules#git-submodules, look it, specially the warning note.
@SalahAdDin Thanks so much, I tried deploying with Heroku cli, and this time it worked! In the log, remote: Cloning into 'plugins/content-export-import'... remote: Submodule path 'plugins/content-export-import': checked out 'ccd9b9c933c70417db758ebb2e3c46028354cc78' remote: remote: Compressing source files... done.,
For some reason, I was deploying by connecting it to Github repo, and the Git submodules wasn't detected.
@chloesun It is because modules just works with direct pushes to heroku (as the warning says).