everythinginjs / strapi-plugin-update-static-content

An Strapi plugin for rebuilding and deploying your static website via Github Actions.
14 stars 9 forks source link

Cannot find module './dist/server' #22

Open kasperbaago opened 2 months ago

kasperbaago commented 2 months ago

First of all, thanks for developing and maintaining this awesome plugin for Strapi!

Just updated to the new version 3.0.0 from 2.0.7, and sadly I get an error after the update. I'm using Strapi version 4.25.8.

Error: Could not load js config file /var/www/node_modules/strapi-plugin-update-static-content/strapi-server.js: Cannot find module './dist/server'   │
│   Require stack:                                                                                                                                        │
│   - /var/www/node_modules/strapi-plugin-update-static-content/strapi-server.js                                                                          │
│   - /var/www/node_modules/@strapi/utils/dist/index.js                                                                                                   │
│   - /var/www/node_modules/@strapi/cloud-cli/dist/index.js                                                                                               │
│   - /var/www/node_modules/@strapi/strapi/dist/commands/index.js                                                                                         │
│   - /var/www/node_modules/@strapi/strapi/dist/cli.js                                                                                                    │
│   - /var/www/node_modules/@strapi/strapi/bin/strapi.js                                                                                                  │
│       at loadJsFile (/var/www/node_modules/@strapi/strapi/dist/core/app-configuration/load-config-file.js:18:13)                                        │
│       at Module.loadFile (/var/www/node_modules/@strapi/strapi/dist/core/app-configuration/load-config-file.js:37:14)                                   │
│       at Object.loadPlugins (/var/www/node_modules/@strapi/strapi/dist/core/loaders/plugins/index.js:90:41)                                             │
│       at async Strapi.loadPlugins (/var/www/node_modules/@strapi/strapi/dist/Strapi.js:311:5)                                                           │
│       at async Promise.all (index 3)                                                                                                                    │
│       at async Strapi.register (/var/www/node_modules/@strapi/strapi/dist/Strapi.js:341:5)                                                              │
│       at async Strapi.load (/var/www/node_modules/@strapi/strapi/dist/Strapi.js:425:5)                                                                  │
│       at async Object.develop (/var/www/node_modules/@strapi/admin/dist/_chunks/index-sNH2VWbC.js:837:28)                                               │
│       at async develop (/var/www/node_modules/@strapi/admin/dist/_chunks/develop-YNTGWKMC.js:61:5)                                                      │
│       at async Command.parseAsync (/var/www/node_modules/commander/lib/command.js:923:5)       

Looks like the strapi-plugin-update-static-content/dist/server not are included in the NPM package?

everythinginjs commented 2 months ago

Hey @kasperbaago have you built strapi after plugin installation?

kasperbaago commented 2 months ago

@everythinginjs Yes, running the strapi build command before starting Strapi.

mvandenbos commented 1 month ago

@everythinginjs , from my side also a big thanks for the updated plugin. I also have the same error as @kasperbaago.

I tried it with the following Strapi Versions and also received the same error:

Manually building your plugin to create the /dist folder just caused a new error to appear. I added this to my package.json to test it:

"build-updater": "cd node_modules/strapi-plugin-update-static-content/ && yarn build"

New Error: Cannot find module '../admin/src/pluginId'