Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kasperbaago opened this issue Aug 19, 2024 · 4 comments
Open

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

kasperbaago opened this issue Aug 19, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@kasperbaago
Copy link

kasperbaago commented Aug 19, 2024

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
Copy link
Owner

everythinginjs commented Aug 20, 2024

Hey @kasperbaago have you built strapi after plugin installation?

@kasperbaago
Copy link
Author

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

@mvandenbos
Copy link

@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:

  • v4.24.0
  • v4.25.11

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'

@everythinginjs everythinginjs self-assigned this Sep 13, 2024
@everythinginjs everythinginjs added the bug Something isn't working label Sep 13, 2024
@ben-reactplus
Copy link

Also experiencing the /dist/server error

My version:

  • @strapi/strapi: 4.11.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants