Git Product home page Git Product logo

strapi-plugin-generate-data's Introduction

Strapi plugin generate-data

This plugin is for generating data for your content-types.

Preview

Features

  • It supports only string with RegExp pattern, email, richtext, integer, decimal, date, media(videos, images, audios, files), boolean enumeration, password, UID, relation, json fields of your content types.
  • Ability to publish data if you have draft mode for your type
  • Ability of choosing which field should be included in generating data
  • It has preview of data in table, which you want to upload
  • Ability of flushing data of the content type you want to upload the generated data
  • It creates content in draft if the content type has draft & publish option

Installations

To install this plugin, you need to add an NPM dependency to your Strapi application:

# Using Yarn
yarn add strapi-plugin-generate-data

# Or using NPM
npm install strapi-plugin-generate-data

It should be activated by default, but if you don't have it in your admin then enable the plugin manually in config/plugins

{
    ...,
    "generate-data": {
        enabled: true,
    },
}

Possible issues

  1. If you don't see generated images on ui and see in console error like content security policy for each image url then you need to update middleware strapi::security in config/middlewares like
...,
 {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": ["'self'", "data:", "blob:", `https://loremflickr.com/`],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
...
  1. If you have issue with upload data locally try to use 127.0.0.1 instead of localhost
  2. If you have issue with no Generate data plugin in left panel, try to run strapi build command it will build your app with plugins Preview

Environment

  • Strapi version 4.x.x

Future plans

  • Custom fields
  • Dynamic zones
  • Components

strapi-plugin-generate-data's People

Contributors

alcir-junior-caju avatar chkp-maksimz avatar element-software avatar ghkdxofla avatar makszhukov avatar rawestmoreland avatar sabrytarek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

strapi-plugin-generate-data's Issues

not working at all...

plugin version: 1.0.23
strapi version: 4.12.1
node version: 18.17.0

CleanShot 2023-08-04 at 20 26 58

plugin.ts:

module.exports = ({ env }) => ({
  sentry: {
    enabled: false,
    config: {
      dsn: env("SENTRY_DSN"),
      sendMetadata: true,
    },
  },
  "generate-data": {
    enabled: true,
  },
});

middleware.ts:

export default [
  "strapi::errors",
  {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": ["'self'", "data:", "blob:", `https://loremflickr.com/`],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  {
    name: "strapi::cors",
    config: {
      origin: ["http://localhost:1337", "http://localhost:4000"],
      methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"],
      headers: ["*"],
      keepHeaderOnError: true,
    },
  },
  "strapi::poweredBy",
  "strapi::logger",
  "strapi::query",
  "strapi::body",
  "strapi::session",
  "strapi::favicon",
  "strapi::public",
];

Cannot find module '@strapi/helper-plugin' or its corresponding type declarations.

Hello,

i just wanted to add the plugin to an existing strapi project with npm install strapi-plugin-generate-data -w WORKSPACE_NAME. However, the installation fails because of the following error:

npm ERR! code 2
npm ERR! path /path/to/monorepo/node_modules/strapi-plugin-generate-data
npm ERR! command failed
npm ERR! command sh /tmp/postinstall-c28efb2c.sh
npm ERR! admin/src/index.tsx(2,42): error TS2307: Cannot find module '@strapi/helper-plugin' or its corresponding type declarations.
npm ERR! admin/src/pages/App/index.tsx(10,26): error TS2307: Cannot find module '@strapi/helper-plugin' or its corresponding type declarations.
npm ERR! admin/src/utils/axiosInstance.ts(6,22): error TS2307: Cannot find module '@strapi/helper-plugin' or its corresponding type declarations.

Best regards
Titus

Fix issue with non-existent `NotFound` Component in `@strapi/helper-plugin`

Environment

  • strapi: v4.15.0

Issue

  • Importing @strapi/helper-plugin for NotFound Component in admin/src/pages/App/index.tsx.
  • This causes npm install to fail with the following error:
{project_directory}\node_modules\strapi-plugin-create-data: command failed.
Exit code: 2
Command: tsc
Arguments:
Directory: {project_directory}\node_modules\strapi-plugin-generate-data
Output:
admin/src/pages/App/index.tsx(10,10): error TS2305: Module '"@strapi/helper-plugin"' has no exported member 'NotFound'.

Workaround

  • For now, change NotFound to AnErrorOccured via patch-package.
import React from 'react';
import { Switch, Route } from 'react-router-dom';
import { AnErrorOccurred } from '@strapi/helper-plugin';
import pluginId from '../../pluginId';
import HomePage from '../HomePage';

const App: React.VoidFunctionComponent = () => {
    return (
        <div>
            <Switch>
                <Route path={`/plugins/${pluginId}`} component={HomePage} exact />
                <Route component={AnErrorOccurred} />
            </Switch>
        </div>
    );
};

export default App;
  • Will also raise a fix PR

Plugin not working with Strapi 4.3.6

I installed the plugin on my Strapi app with a single collection and could not get it to work. I followed all the steps highlighted in the readme.

System info

Ubuntu 22.04 (WSL 2)
Node 16.16.0
npm 8.11.0
Strapi 4.3.6

I got a console error when i clicked a collection type in the plugin page and then a while screen. The page was completely blank and not displaying anything.

Did you test this on the latest Strapi release?

Here are the errors

- ReferenceError: values is not defined
    u http://localhost:1337/admin/main.1549ff7e.js:9826
    ei http://localhost:1337/admin/main.1549ff7e.js:9886
    Ks http://localhost:1337/admin/main.1549ff7e.js:9890
    Ss http://localhost:1337/admin/main.1549ff7e.js:9890
    uc http://localhost:1337/admin/main.1549ff7e.js:9890
    vi http://localhost:1337/admin/main.1549ff7e.js:9890
    Ui http://localhost:1337/admin/main.1549ff7e.js:9888
    cl http://localhost:1337/admin/main.1549ff7e.js:9886
    unstable_runWithPriority http://localhost:1337/admin/main.1549ff7e.js:9918
    U0 http://localhost:1337/admin/main.1549ff7e.js:9886
    cl http://localhost:1337/admin/main.1549ff7e.js:9886
    wn http://localhost:1337/admin/main.1549ff7e.js:9886
    Hn http://localhost:1337/admin/main.1549ff7e.js:9888
    ti http://localhost:1337/admin/main.1549ff7e.js:9886
    Z http://localhost:1337/admin/main.1549ff7e.js:9827
    W http://localhost:1337/admin/main.1549ff7e.js:9827
    _ http://localhost:1337/admin/main.1549ff7e.js:9827
    _ http://localhost:1337/admin/main.1549ff7e.js:9827
    promise callback*K http://localhost:1337/admin/main.1549ff7e.js:9827
    n http://localhost:1337/admin/main.1549ff7e.js:9827
    n http://localhost:1337/admin/main.1549ff7e.js:9827
    Z http://localhost:1337/admin/main.1549ff7e.js:9827
    B http://localhost:1337/admin/main.1549ff7e.js:9827
    Rs http://localhost:1337/admin/main.1549ff7e.js:9890
    unstable_runWithPriority http://localhost:1337/admin/main.1549ff7e.js:9918
    U0 http://localhost:1337/admin/main.1549ff7e.js:9886
    S0 http://localhost:1337/admin/main.1549ff7e.js:9890
    tc http://localhost:1337/admin/main.1549ff7e.js:9890
    K http://localhost:1337/admin/main.1549ff7e.js:9918
    onmessage http://localhost:1337/admin/main.1549ff7e.js:9918
    60053 http://localhost:1337/admin/main.1549ff7e.js:9918
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    63840 http://localhost:1337/admin/main.1549ff7e.js:9918
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    64448 http://localhost:1337/admin/main.1549ff7e.js:9882
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    73935 http://localhost:1337/admin/main.1549ff7e.js:9890
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    17025 http://localhost:1337/admin/main.1549ff7e.js:9521
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    o http://localhost:1337/admin/main.1549ff7e.js:9935
    <anonymous> http://localhost:1337/admin/main.1549ff7e.js:9935
    r http://localhost:1337/admin/runtime~main.b19a54e9.js:2
    <anonymous> http://localhost:1337/admin/main.1549ff7e.js:1
[main.1549ff7e.js:9888:69](http://localhost:1337/admin/main.1549ff7e.js)

- Uncaught (in promise) ReferenceError: values is not defined
    u http://localhost:1337/admin/main.1549ff7e.js:9826
    ei http://localhost:1337/admin/main.1549ff7e.js:9886
    Ks http://localhost:1337/admin/main.1549ff7e.js:9890
    Ss http://localhost:1337/admin/main.1549ff7e.js:9890
    uc http://localhost:1337/admin/main.1549ff7e.js:9890
    vi http://localhost:1337/admin/main.1549ff7e.js:9890
    Ui http://localhost:1337/admin/main.1549ff7e.js:9888
    cl http://localhost:1337/admin/main.1549ff7e.js:9886
    unstable_runWithPriority http://localhost:1337/admin/main.1549ff7e.js:9918
    U0 http://localhost:1337/admin/main.1549ff7e.js:9886
    cl http://localhost:1337/admin/main.1549ff7e.js:9886
    wn http://localhost:1337/admin/main.1549ff7e.js:9886
    Hn http://localhost:1337/admin/main.1549ff7e.js:9888
    ti http://localhost:1337/admin/main.1549ff7e.js:9886
    Z http://localhost:1337/admin/main.1549ff7e.js:9827
    W http://localhost:1337/admin/main.1549ff7e.js:9827
    _ http://localhost:1337/admin/main.1549ff7e.js:9827
    _ http://localhost:1337/admin/main.1549ff7e.js:9827
    promise callback*K http://localhost:1337/admin/main.1549ff7e.js:9827
    n http://localhost:1337/admin/main.1549ff7e.js:9827
    n http://localhost:1337/admin/main.1549ff7e.js:9827
    Z http://localhost:1337/admin/main.1549ff7e.js:9827
    B http://localhost:1337/admin/main.1549ff7e.js:9827
    Rs http://localhost:1337/admin/main.1549ff7e.js:9890
    unstable_runWithPriority http://localhost:1337/admin/main.1549ff7e.js:9918
    U0 http://localhost:1337/admin/main.1549ff7e.js:9886
    S0 http://localhost:1337/admin/main.1549ff7e.js:9890
    tc http://localhost:1337/admin/main.1549ff7e.js:9890
    K http://localhost:1337/admin/main.1549ff7e.js:9918
    onmessage http://localhost:1337/admin/main.1549ff7e.js:9918
    60053 http://localhost:1337/admin/main.1549ff7e.js:9918
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    63840 http://localhost:1337/admin/main.1549ff7e.js:9918
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    64448 http://localhost:1337/admin/main.1549ff7e.js:9882
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    73935 http://localhost:1337/admin/main.1549ff7e.js:9890
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    17025 http://localhost:1337/admin/main.1549ff7e.js:9521
    a http://localhost:1337/admin/runtime~main.b19a54e9.js:1
    o http://localhost:1337/admin/main.1549ff7e.js:9935
    <anonymous> http://localhost:1337/admin/main.1549ff7e.js:9935
    r http://localhost:1337/admin/runtime~main.b19a54e9.js:2
    <anonymous> http://localhost:1337/admin/main.1549ff7e.js:1

Generate Images + Video and get error cause the crash app.

Request info:

curl 'http://localhost:1337/generate-data/upload' \ -H 'Accept: application/json' \ -H 'Accept-Language: en-US,en;q=0.9,vi-VN;q=0.8,vi;q=0.7,fr-FR;q=0.6,fr;q=0.5' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNjk0NDAwODU0LCJleHAiOjE2OTUwMDU2NTR9.vM64f10tks_-qVf335_WMlrsHNYaBXbnoeBSIb_BKw8' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/json' \ -H 'Cookie: 5d89dac18813e15aa2f75788275e3588=ithprgaddacmchk3u1bo0mbqds; collapsedNodes=' \ -H 'Origin: http://localhost:1337' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36' \ -H 'sec-ch-ua: "Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' \ --data-raw '{"fileUpload":[["https://loremflickr.com/640/480/people?lock=57698","https://loremflickr.com/640/480/cats?lock=97017"],["/generate-data/videos/7.mp4","/generate-data/videos/3.mp4","/generate-data/videos/3.mp4"],["/generate-data/videos/6.mp4"],["/generate-data/videos/7.mp4","/generate-data/videos/10.mp4"],["/generate-data/videos/4.mp4"],["https://loremflickr.com/640/480/food?lock=28923","https://loremflickr.com/640/480/food?lock=10975"],["https://loremflickr.com/640/480/cats?lock=91417","https://loremflickr.com/640/480/animals?lock=21913"],["/generate-data/videos/5.mp4"],["/generate-data/audios/2.wav","/generate-data/audios/4.wav","/generate-data/audios/1.wav"],["/generate-data/videos/1.mp4","/generate-data/videos/3.mp4","/generate-data/videos/4.mp4"]]}' \ --compressed

Command output:

`[2023-09-11 02:55:48.730] http: GET /content-manager/collection-types/api::article.article?fields[0]=id&page=1 (169 ms) 200
[2023-09-11 02:55:48.772] http: GET /content-manager/collection-types/api::assistance-type.assistance-type?fields[0]=id&page=1 (207 ms) 200
[2023-09-11 02:55:48.786] http: GET /content-manager/collection-types/api::category.category?fields[0]=id&page=1 (209 ms) 200
[2023-09-11 02:55:48.813] http: GET /content-manager/collection-types/api::state.state?fields[0]=id&page=1 (231 ms) 200
[2023-09-11 02:55:48.855] http: GET /content-manager/collection-types/plugin::users-permissions.user?fields[0]=id&page=1 (275 ms) 200
[2023-09-11 02:55:49.047] http: GET /content-manager/collection-types/api::submission.submission?fields[0]=id&page=1 (474 ms) 200
[2023-09-11 02:55:49.150] http: GET /content-manager/collection-types/api::submission.submission?fields[0]=id&page=1 (101 ms) 200
[2023-09-11 02:55:49.291] http: GET /content-manager/collection-types/api::submission.submission?fields[0]=id&page=1 (137 ms) 200
[2023-09-11 02:55:49.407] http: GET /content-manager/collection-types/api::submission.submission?fields[0]=id&page=1 (111 ms) 200
[2023-09-11 02:55:49.505] http: GET /generate-data/videos/3.mp4 (7 ms) 200
[2023-09-11 02:55:49.514] http: GET /generate-data/videos/7.mp4 (8 ms) 200
[2023-09-11 02:55:49.520] http: GET /generate-data/videos/6.mp4 (5 ms) 200
[2023-09-11 02:55:49.521] http: GET /generate-data/videos/10.mp4 (25 ms) 404
[2023-09-11 02:55:49.525] http: GET /generate-data/videos/3.mp4 (2 ms) 200
[2023-09-11 02:55:49.562] http: GET /generate-data/videos/7.mp4 (36 ms) 200
[2023-09-11 02:55:49.591] http: GET /generate-data/videos/4.mp4 (22 ms) 200
[2023-09-11 02:55:49.685] http: GET /generate-data/videos/5.mp4 (32 ms) 200
[2023-09-11 02:55:49.811] http: GET /generate-data/audios/2.wav (121 ms) 200
[2023-09-11 02:55:49.858] http: GET /generate-data/audios/4.wav (45 ms) 200
[2023-09-11 02:55:49.892] http: GET /generate-data/audios/1.wav (23 ms) 200
[2023-09-11 02:55:49.898] http: GET /generate-data/videos/3.mp4 (5 ms) 200
[2023-09-11 02:55:49.915] http: GET /generate-data/videos/1.mp4 (15 ms) 200
[2023-09-11 02:55:49.925] http: GET /generate-data/videos/4.mp4 (7 ms) 200
[AxiosError: Request failed with status code 404] {
code: 'ERR_BAD_REQUEST',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [Function: httpAdapter],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: { FormData: [Function] },
validateStatus: [Function: validateStatus],
headers: {
Accept: 'application/json, text/plain, /',
'User-Agent': 'axios/0.27.2'
},
responseType: 'stream',
httpsAgent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object: null prototype],
requests: [Object: null prototype] {},
sockets: [Object: null prototype] {},
freeSockets: [Object: null prototype] {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 0,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(kCapture)]: false
},
method: 'get',
url: '/generate-data/videos/5.mp4',
data: undefined
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype] {
abort: [Function (anonymous)],
aborted: [Function (anonymous)],
connect: [Function (anonymous)],
error: [Function (anonymous)],
socket: [Function (anonymous)],
timeout: [Function (anonymous)],
finish: [Function: requestOnFinish]
},
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
socket: Socket {
connecting: false,
_hadError: false,
_parent: null,
_host: null,
_closeAfterHandlingError: false,
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 6,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
parser: null,
_httpMessage: [Circular *1],
[Symbol(async_id_symbol)]: 289684,
[Symbol(kHandle)]: [TCP],
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kSetNoDelay)]: true,
[Symbol(kSetKeepAlive)]: true,
[Symbol(kSetKeepAliveInitialDelay)]: 60,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0
},
_header: 'GET /generate-data/videos/5.mp4 HTTP/1.1\r\n' +
'Accept: application/json, text/plain, /\r\n' +
'User-Agent: axios/0.27.2\r\n' +
'Host: [::1]\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 80,
protocol: 'http:',
options: [Object: null prototype],
requests: [Object: null prototype] {},
sockets: [Object: null prototype],
freeSockets: [Object: null prototype] {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 14,
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'GET',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/generate-data/videos/5.mp4',
_ended: false,
res: IncomingMessage {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
socket: [Socket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
rawHeaders: [Array],
rawTrailers: [],
joinDuplicateHeaders: undefined,
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 404,
statusMessage: 'Not Found',
client: [Socket],
_consuming: false,
_dumped: false,
req: [Circular *1],
responseUrl: 'http://[::1]/generate-data/videos/5.mp4',
redirects: [],
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 10,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: '::1',
protocol: 'http:',
_redirectable: Writable {
_writableState: [WritableState],
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
_options: [Object],
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 0,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: [Circular *1],
_currentUrl: 'http://[::1]/generate-data/videos/5.mp4',
[Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
'user-agent': [Array],
host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kUniqueHeaders)]: null
},
response: {
status: 404,
statusText: 'Not Found',
headers: {
date: 'Mon, 11 Sep 2023 02:56:08 GMT',
server: 'Apache',
'content-length': '196',
connection: 'close',
'content-type': 'text/html; charset=iso-8859-1'
},
config: {
transitional: [Object],
adapter: [Function: httpAdapter],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: [Object],
validateStatus: [Function: validateStatus],
headers: [Object],
responseType: 'stream',
httpsAgent: [Agent],
method: 'get',
url: '/generate-data/videos/5.mp4',
data: undefined
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype],
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
socket: [Socket],
_header: 'GET /generate-data/videos/5.mp4 HTTP/1.1\r\n' +
'Accept: application/json, text/plain, /\r\n' +
'User-Agent: axios/0.27.2\r\n' +
'Host: [::1]\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: [Agent],
socketPath: undefined,
method: 'GET',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/generate-data/videos/5.mp4',
_ended: false,
res: [IncomingMessage],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: '::1',
protocol: 'http:',
_redirectable: [Writable],
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype],
[Symbol(errored)]: null,
[Symbol(kUniqueHeaders)]: null
},
data: IncomingMessage {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
socket: [Socket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
rawHeaders: [Array],
rawTrailers: [],
joinDuplicateHeaders: undefined,
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 404,
statusMessage: 'Not Found',
client: [Socket],
_consuming: false,
_dumped: false,
req: [ClientRequest],
responseUrl: 'http://[::1]/generate-data/videos/5.mp4',
redirects: [],
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 10,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0
}
}
}
[2023-09-11 02:56:08.679] http: POST /generate-data/upload (64 ms) 200
[2023-09-11 02:56:08.689] http: POST /generate-data/create/api::submission.submission (5 ms) 200
/Users/chungnq253/Projects/xpon/att/att-cms/node_modules/@strapi/utils/dist/validators.js:86
throw new errors_1.YupValidationError(error, errorMessage);
^

YupValidationError: select count("t0"."id") as "count" from "public"."files" as "t0" where ("t0"."id" in ($1)) limit $2 - invalid input syntax for type integer: "/generate-data/videos/6.mp4"
at handleYupError (/Users/chungnq253/Projects/xpon/att/att-cms/node_modules/@strapi/utils/dist/validators.js:86:11)
at /Users/chungnq253/Projects/xpon/att/att-cms/node_modules/@strapi/utils/dist/validators.js:98:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.create (/Users/chungnq253/Projects/xpon/att/att-cms/node_modules/@strapi/strapi/lib/services/entity-service/index.js:156:23)
at async Object. (/Users/chungnq253/Projects/xpon/att/att-cms/node_modules/@strapi/strapi/lib/services/entity-service/index.js:415:20)
at async Object.create (/Users/chungnq253/Projects/xpon/att/att-cms/node_modules/@strapi/plugin-i18n/server/services/entity-service-decorator.js:130:19) {
details: {
errors: [
{
path: [],
message: 'select count("t0"."id") as "count" from "public"."files" as "t0" where ("t0"."id" in ($1)) limit $2 - invalid input syntax for type integer: "/generate-data/videos/6.mp4"',
name: 'ValidationError'
}
]
}
}

Node.js v18.16.1
✨ Done in 229.40s.`

image

The "path" argument must be of type string. Received undefined

Hello,

on a fresh install of Strapi 4.5.1 (javascript no typescript) i am getting this error when enabling the pulgin:

yarn run v1.22.17
$ strapi develop
[2022-11-19 14:56:35.539] debug: ⛔️ Server wasn't able to start properly.
[2022-11-19 14:56:35.542] error: The "path" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:393:5)
    at validateString (node:internal/validators:163:11)
    at join (node:path:429:7)
    at Object.loadPlugins (F:\Projekte\maklersuite-backend\node_modules\@strapi\strapi\lib\core\loaders\plugins\index.js:88:34)
    at async Strapi.loadPlugins (F:\Projekte\maklersuite-backend\node_modules\@strapi\strapi\lib\Strapi.js:333:5)
    at async Promise.all (index 2)
    at async Strapi.register (F:\Projekte\maklersuite-backend\node_modules\@strapi\strapi\lib\Strapi.js:369:5)
    at async Strapi.load (F:\Projekte\maklersuite-backend\node_modules\@strapi\strapi\lib\Strapi.js:474:5)
    at async Strapi.start (F:\Projekte\maklersuite-backend\node_modules\@strapi\strapi\lib\Strapi.js:212:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this `command.

config/plugins.js

module.exports = ({ env }) => ({
    "generate-data": {
        enabled: true,
    },
});

Installation Error

I can't install the package, the following error happens:

error /Users/mac/my-project/apps/api/node_modules/strapi-plugin-generate-data: Command failed. Exit code: 2 Command: tsc Arguments: Directory: /Users/mac/my-project/apps/api/node_modules/strapi-plugin-generate-data Output: admin/src/pages/App/index.tsx(9,10): error TS2305: Module '"react-router-dom"' has no exported member 'Switch'. admin/src/pages/App/index.tsx(20,21): error TS2322: Type '{ path: string; component: FC<{}>; exact: true; }' is not assignable to type 'IntrinsicAttributes & (PathRouteProps | LayoutRouteProps | IndexRouteProps)'. Property 'component' does not exist on type 'IntrinsicAttributes & (PathRouteProps | LayoutRouteProps | IndexRouteProps)'. admin/src/pages/App/index.tsx(23,24): error TS2322: Type '{ component: any; }' is not assignable to type 'IntrinsicAttributes & (PathRouteProps | LayoutRouteProps | IndexRouteProps)'. Property 'component' does not exist on type 'IntrinsicAttributes & (PathRouteProps | LayoutRouteProps | IndexRouteProps)'. admin/src/pages/HomePage/index.tsx(2,23): error TS2305: Module '"react-router-dom"' has no exported member 'useHistory'.

Install error - Cannot find module @strapi/design-system

System Information:
Strapi: 4.5.1
Node: v14.20.0
OS: Ubuntu 20.04.2 LTS
Yarn: 1.22.19
Npm: 6.14.17

I'm unable to install this plugin.
error in strapi-plugin-generate-data: Command failed. Exit code: 2 Command: tsc Output: admin/src/components/GeneratedDataTable/GeneratedDataTable.tsx(3,49): error TS2307: Cannot find module '@strapi/design-system/Table' or its corresponding type declarations.

Last message repeated for each design system component

500 with image component in model

Hello, trying to generate data on localhost. Getting internal server error as a response if the model has an image component in it
image

P.S. Also it doesn't fill relations and some fields (it simply doesn't appear in the UI as an option)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.