Strapi: Middleware "strapi::body": Cannot destructure property 'config' of 'strapi.plugin(...)' as it is undefined - sqlite

I am trying to install a fresh Strapi app on my mac, by running the
npx create-strapi-app#latest my-project --quickstart
commnand. It installs the Strapi app fine, but when I try to run "npm run develop", I get this error:
"Strapi: Middleware "strapi::body": Cannot destructure property 'config' of 'strapi.plugin(...)' as it is undefined."
And the app doesn't start. full error text is as follows:
Middleware "strapi::body": Cannot destructure property 'config' of 'strapi.plugin(...)' as it is undefined.
Error: Middleware "strapi::body": Cannot destructure property 'config' of 'strapi.plugin(...)' as it is undefined.
at instantiateMiddleware (/Users/davit/Github/my-project/node_modules/#strapi/strapi/lib/services/server/middleware.js:12:11)
at resolveMiddlewares (/Users/davit/Github/my-project/node_modules/#strapi/strapi/lib/services/server/middleware.js:56:18)
at registerApplicationMiddlewares (/Users/davit/Github/my-project/node_modules/#strapi/strapi/lib/services/server/register-middlewares.js:66:29)
at async Object.initMiddlewares (/Users/davit/Github/my-project/node_modules/#strapi/strapi/lib/services/server/index.js:99:7)
at async Strapi.bootstrap (/Users/davit/Github/my-project/node_modules/#strapi/strapi/lib/Strapi.js:445:5)
at async Strapi.load (/Users/davit/Github/my-project/node_modules/#strapi/strapi/lib/Strapi.js:457:5)
at async Strapi.start (/Users/davit/Github/my-project/node_modules/#strapi/strapi/lib/Strapi.js:198:9)
Would appreciate any help regarding this issue.

Got the same exception when yarn develop.
Make sure you have right version range for node
node -v if not use nvm use 14.19.1 (or above)
Go to package.json and change strapi version.
from "#strapi/strapi": "^4.3.5" to "#strapi/strapi": "^4.3.6"
Remove package-lock.json and yarn.lock
Run npm install or/and yarn install

I had also posted this question in Strapi forums and it turns out that the problem was with Strapi 4.3.5. They advised updating to 4.3.6 as this issue had been hotfixed. I can confirm that this issue no longer exists on Strapi 4.3.6.

Related

Vague error in Vercel deployment (exit with code 1)

So normally Vercel gives me decent error messages, but this one seems to have no detail. Just
"failed with exit code 1".
For context, I just started this project w the basic NextJS template, made a few modifications, and this is my first deploy.
Failed once and I assumed it was because NextJS has strict type checking on by default, so I modified the next.config.js file as follows (per here):
module.exports = {
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
};
But still failed. Here is the full log:
10:23:27.575 Cloning github.com/lawderp/physical (Branch: main, Commit: 8f97554)
10:23:28.589 Cloning completed: 1.014s
10:23:28.614 Analyzing source code...
10:23:29.739 Installing build runtime...
10:23:31.612 Build runtime installed: 1.873s
10:23:34.043 Looking up build cache...
10:23:34.164 Build cache found. Downloading...
10:23:35.100 Build cache downloaded [21.48 MB]: 936.007ms
10:23:36.250 Installing dependencies...
10:23:36.489 yarn install v1.22.11
10:23:36.547 [1/4] Resolving packages...
10:23:36.734 success Already up-to-date.
10:23:36.743 Done in 0.26s.
10:23:36.754 Detected Next.js version: 11.1.2
10:23:36.755 Running "yarn run build"
10:23:37.021 yarn run v1.22.11
10:23:37.047 $ next build
10:23:37.820 info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
10:23:37.976 info - Skipping validation of types...
10:23:40.439 error Command failed with exit code 1.
10:23:40.439 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
10:23:40.456 Error: Command "yarn run build" exited with 1
Still not sure what the issue was but eventually figured out how to get past this - ignored ESLint during build by adding the following to next.config.js:
eslint: {
ignoreDuringBuilds: true,
},
(I don't advise doing this but this was quick low-stakes experiment)
I received the same vague message after making eslint alterations. Locally linting and deployment was successful, however deploying to vercel failed like yours.
Although "ignoreDuringBuilds": "true" in my .eslint.json did band-aid fix the issue, I was able to rollback each eslint change and found that my "linebreak-style": ["error", "windows"] was the underlying issue.
It passed linting locally, but failed on vercel deployment. I've fixed my line-breaks and all works great now without having to ignore during builds.

I want to use Vue js with Symfony 5, but I faced an error when run this command "yarn encore dev-server"

I run the command yarn encore dev-server in Symfony 5 with Vue.js. I faced an error below:
PS C:\Apache24\htdocs\api_example> yarn encore dev-server
yarn run v1.22.5
$ C:\Apache24\htdocs\api_example\node_modules\.bin\encore dev-server
Running webpack-dev-server ...
RECOMMEND To create a smaller (and CSP-compliant) build, see https://symfony.com/doc/current/frontend/encore/vuejs.html#runtime-compiler-build
**[webpack-cli] Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client has an unknown property 'host'. These properties are valid:
object { logging?, overlay?, progress?, webSocketTransport?, webSocketURL? }**
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Webpack Dev Server has just released a new version: v4.0.0-rc.0. It's incompatible with the (default settings of) Webpack Encore.
You can stick to v4.0.0-beta.3 for a while, until Webpack Encore has been updated to support the new version.
Use yarn add webpack-dev-server#v4.0.0-beta.3 --dev to use this exact version.
Follow this issue to see if there is any progress, or if you want to use quick fixes to use the new webpack-dev-server.

Angular ERROR: PostCSS received undefined instead of CSS string

Trying to build an Angular project and I'm getting the errors below. This project built fine last week. I made some changes to other projects that use the Dlls from this project, but no changes to this project. I already spent a lot of time troubleshooting it with no luck and appreciate any help.
ERROR: PostCSS received undefined instead of CSS string
An unhandled exception occurred: PostCSS received undefined instead of CSS string
This can sometimes happen if node-sass was compiled for a different version of Node.js than you're currently running (ie if you've recently changed your Node.js version). You can fix that with:
npm rebuild node-sass
if you are using webpack, and trying to use sass-loader, also add sass
I had this same issue when attempting to test an Angular library, and the issue was I had [``] instead of [] in the styles property of my component metadata.
Wrong
#Component({
selector: 'my-input',
template: `
<input
... />
`,
styles: [``],
Right
#Component({
selector: 'my-input',
template: `
<input
... />
`,
styles: [],
I had similar problem. I was trying to build an angular library and the message below appeared:
Building Angular Package
------------------------------------------------------------------------------
Building entry point 'library-name'
------------------------------------------------------------------------------
Compiling TypeScript sources through ngc
ERROR: PostCSS received undefined instead of CSS string
An unhandled exception occurred: PostCSS received undefined instead of CSS string
See "/tmp/ng-itlEgm/angular-errors.log" for further details.
[12:03:38] 'compile' errored after 17 s
[12:03:38] Error: Command `ng build library-name --prod` exited with code 127
at ChildProcess.handleSubShellExit (/node_modules/gulp-run/command.js:166:13)
at Object.onceWrapper (events.js:422:26)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:505:15)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
[12:03:38] 'build' errored after 17 s
I was using gulp-run to execute the command ng build library-name --prod. But, executing the command ng build library-name --prod directly on the terminal, the log error was smaller, but similar too.
The problem was in one component. The component had one styleURL (Angular component decorator), like this:
...component.css
but, the library uses scss. So, I changed the path to:
...component.scss
and I executed the command 'ng build library-name --prod'. So, the error didn't appear again.
I was using NVM v0.35.2 (allow to have more than one NodeJS version installed in my machine); NodeJS v12.18.2; Ubuntu x64 18.0.4 LTS and Angular CLI 9.1.9.
I faced the same situation now and the command that helped me is -
npm i node-sass -D
Check the node version, see if the version of node changes cause this problem. I use node version 16.14.2 which occured this error, after switch to 12.16.1 it works well. Just check your node-sass and node version will find a way out.
This can happen due to change in version of node. I had same issue with a NUXT app. What I did was
using yarn, in the root directory of your project, run yarn. But if you're using npm run npm install
start your project again.

Vuejs2 firebase with electron error

I have configured electron with vuejs and i would like to add firebae to my project so i have
In my main.js
import * as firebase from 'firebase'
let firebasconfig = {
//config from firebase project
};
Vue.prototype.$firebase = firebase.initializeApp(firebasconfig);
But now am getting an error
Error: Failed to load gRPC binary module because it was not installed
for the current system
Expected directory: electron-v1.8-linux-x64-glibc
Found: [node-v59-linux-x64-glibc]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module
I have tried running rebuild but still fails
What elese do i need to do for this to work
I encouter the same issue with
vue-electron 1.0.6
firebase 5.4.2
vuefire 1.4.5
node 6.10.3
The following manipulation has worked for me. I have downgraded :
firebase to 4.6.0
vuefire to 1.4.4
Then ran npm rebuild and yarn and now it works.
I'm not sure all the things I have done are necessary. But for sure it looks like a problem with firebase.

Integrating Apollo to meteor app

When I'm trying to integrate an apollo server to a meteor app I get errors as soon as I try to open graphiql. If I create an express app and connect it with webapp.connectHandlers, and put apollo server to one of that express app's routes, thing work, but they don't work in "meteor way", which I would really like to have, since I would get access to the user object, authorization etc.
Error, which I see in graphiql as soon as it loads:
Error: Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory
stacktrace:
at invariant (/Users/.../node_modules/graphql/jsutils/invariant.js:18:11)<br> at Object.validate (/Users/.../node_modules/graphql/validation/validate.js:59:72)<br> at doRunQuery (/Users/.../node_modules/apollo-server-core/dist/runQuery.js:88:38)<br> at /Users/.../node_modules/apollo-server-core/dist/runQuery.js:22:54<br> at /Users/.../.meteor/packages/promise/.0.10.0.borizy.o9z8++os+web.browser+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
server code:
import {makeExecutableSchema} from 'graphql-tools';
import {typeDefs} from './schema';
import {resolvers} from './resolvers';
import { createApolloServer } from 'meteor/apollo';
export const schema = makeExecutableSchema({
typeDefs,
resolvers
});
createApolloServer({
schema
});
Everything seems legit and works with express, but not with meteor. What is the reason? How can I fix it?
The current version of meteor/apollo is out of date with the latest apollo npm packages. https://github.com/Swydo/ddp-apollo is up-to-date and does the integration in a "meteor way" 😊
Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory
If this is the problem, it would be solved by
rm -rf node_modules/*
npm install

Resources