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

Strapi CKEditor5 deployment fails, says module not found #107

Closed
denvermullets opened this issue Apr 15, 2024 · 1 comment
Closed

Strapi CKEditor5 deployment fails, says module not found #107

denvermullets opened this issue Apr 15, 2024 · 1 comment

Comments

@denvermullets
Copy link

denvermullets commented Apr 15, 2024

my deployments are failing when adding this plugin to strapi. everything is working fine locally but the logs show this error when strapi tries to start up.

==> Running 'yarn start'
INFOyarn run v1.22.22
INFO$ strapi start
DEBUG[2024-04-14 12:58:15.539] debug: ⛔️ Server wasn't able to start properly.
ERROR[2024-04-14 12:58:15.540] error: Cannot find module '/opt/render/project/src/src/plugins/strapi-plugin-ckeditor/package.json'
INFORequire stack:
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/get-enabled-plugins.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/Strapi.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/action.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/command.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/cli.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/bin/strapi.js
ERRORError: Cannot find module '/opt/render/project/src/src/plugins/strapi-plugin-ckeditor/package.json'
INFORequire stack:
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/get-enabled-plugins.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/Strapi.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/action.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/command.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/cli.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/bin/strapi.js
INFO    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
INFO    at Module._load (node:internal/modules/cjs/loader:984:27)
INFO    at Module.require (node:internal/modules/cjs/loader:1231:19)
INFO    at require (node:internal/modules/helpers:179:18)
INFO    at /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/get-enabled-plugins.js:92:27
INFO    at /opt/render/project/src/node_modules/lodash/lodash.js:4967:15
INFO    at baseForOwn (/opt/render/project/src/node_modules/lodash/lodash.js:3032:24)
INFO    at /opt/render/project/src/node_modules/lodash/lodash.js:4936:18
INFO    at Function.forEach (/opt/render/project/src/node_modules/lodash/lodash.js:9410:14)
INFO    at Module.getEnabledPlugins (/opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/get-enabled-plugins.js:83:22)
ERRORerror Command failed with exit code 1.
INFOinfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
INFO==> Common ways to troubleshoot your deploy: https://docs.render.com/troubleshooting-deploys
INFO==> Requesting node version >=18.0.0 <=20.x.x
INFO==> Using Node version 20.12.2 via /opt/render/project/src/package.json
INFO==> Docs on specifying a Node version: https://render.com/docs/node-version
INFO==> Using Bun version 1.1.0 (default)
INFO==> Docs on specifying a bun version: https://render.com/docs/bun-version
INFO==> Running 'yarn start'
INFOyarn run v1.22.22
INFO$ strapi start
DEBUG[2024-04-14 12:58:22.030] debug: ⛔️ Server wasn't able to start properly.
ERROR[2024-04-14 12:58:22.031] error: Cannot find module '/opt/render/project/src/src/plugins/strapi-plugin-ckeditor/package.json'
INFORequire stack:
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/get-enabled-plugins.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/Strapi.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/action.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/command.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/cli.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/bin/strapi.js
ERRORError: Cannot find module '/opt/render/project/src/src/plugins/strapi-plugin-ckeditor/package.json'
INFORequire stack:
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/get-enabled-plugins.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/Strapi.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/action.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/command.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/commands/index.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/dist/cli.js
INFO- /opt/render/project/src/node_modules/@strapi/strapi/bin/strapi.js
INFO    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
INFO    at Module._load (node:internal/modules/cjs/loader:984:27)
INFO    at Module.require (node:internal/modules/cjs/loader:1231:19)
INFO    at require (node:internal/modules/helpers:179:18)
INFO    at /opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/get-enabled-plugins.js:92:27
INFO    at /opt/render/project/src/node_modules/lodash/lodash.js:4967:15
INFO    at baseForOwn (/opt/render/project/src/node_modules/lodash/lodash.js:3032:24)
INFO    at /opt/render/project/src/node_modules/lodash/lodash.js:4936:18
INFO    at Function.forEach (/opt/render/project/src/node_modules/lodash/lodash.js:9410:14)
INFO    at Module.getEnabledPlugins (/opt/render/project/src/node_modules/@strapi/strapi/dist/core/loaders/plugins/get-enabled-plugins.js:83:22)
ERRORerror Command failed with exit code 1.
INFOinfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

here's my root package.json:

{
  "workspaces": [
    "./src/plugins/*"
  ],
  "dependencies": {
    "@ckeditor/strapi-plugin-ckeditor": "^0.0.11",
    "@strapi/plugin-cloud": "4.17.0",
    "@strapi/plugin-i18n": "4.17.0",
    "@strapi/plugin-users-permissions": "4.17.0",
    "@strapi/provider-upload-cloudinary": "^4.17.0",
    "@strapi/strapi": "4.17.0",
    "pg": "8.8.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-router-dom": "5.3.4",
    "styled-components": "5.3.3"
  },
  "devDependencies": {},
  "engines": {
    "node": ">=18.0.0 <=20.x.x",
    "npm": ">=6.0.0"
  },
}

just for the sake of convo, there is a package.json here: src/plugins/strapi-plugin-ckeditor/package.json

my config/env plugin.js (also have copied this info into the env folder this is failing on):

module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "cloudinary",
      providerOptions: {
        cloud_name: env("CLOUDINARY_NAME"),
        api_key: env("CLOUDINARY_KEY"),
        api_secret: env("CLOUDINARY_SECRET"),
      },
    },
  },
  ckeditor: {
    enabled: true,
    resolve: "./src/plugins/strapi-plugin-ckeditor",
  },
});

any help would be appreciated!

@denvermullets
Copy link
Author

ok, i finally got this resolved. not sure exactly why, but for whatever reason it wasn't tracking all of the files.

cleared git cache, re-add files, commit and push fixed it.

git rm -rf --cache .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant