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

DB Data Not Imported #67

Open
BenGreyTwo opened this issue Dec 7, 2022 · 5 comments
Open

DB Data Not Imported #67

BenGreyTwo opened this issue Dec 7, 2022 · 5 comments

Comments

@BenGreyTwo
Copy link

When running npx create-strapi-app my-app-name --template corporate and going through the manual setup, the data to build the starter site is not imported into the DB.
The tables are created but not populated.

I've tried on several node + npm versions
node: v16.18.1
npm: 8.19.2

@BenGreyTwo BenGreyTwo changed the title DB Date Not Imported DB Data Not Imported Dec 8, 2022
@subaquatic-pierre
Copy link

I can confirm the same issue with blog template.
running npx create-strapi-app my-app-name --template blog, does not bootstrap the app with any data.
Tried with both node v16 and v18

@NeseemGit
Copy link

Same issue here. The data does not get populated. I don't know the root cause but it seems to be related to the Strapi version. The data does populate in v4.2 but not 4.5.

In addition, when adding the data manually, the homepage slug in the corporate starter codebase is expecting an empty string "" but when adding pages in the GUI, a blank value get set as null in the DB which will load a 404 for the homepage.

@subaquatic-pierre
Copy link

It seems like the CLI is not pulling the template from the correct repo perhaps. I copied the contents from this folder https://github.com/strapi/starters-and-templates/tree/main/packages/templates/blog/template into a newly created project, I'm sure it will work for corporate as well. Running npx strapi develop the first time populates the data. It is a workaround for me for now.

@webhype
Copy link

webhype commented Jan 3, 2023

Here's the ugliest hackiest workaround (this is on Mac OS Ventura). You have to trick the starter installer to download and execute Strapi v4.4.7 instead of v4.5.5. Why 4.4.7? Because I have determined through trial and error that template importing broke as of version 4.5.0. 😀

cd /usr/local/bin
ls -alt create-strapi*

Verify that from your previous failed attempts, there's a symlink that looks like this:

create-strapi-starter -> ../../../Users/macuser/.config/yarn/global/node_modules/.bin/create-strapi-starter

Rename the symlink to create-strapi-starter@4.4.7 like so:

mv create-strapi-starter create-strapi-starter@4.4.7

Due to a bug (?) in the strapi-starter and strapi-template scripts, it can download an older version of Strapi by specifying something like @4.4.7 but it can't launch it because it expects the name of the symlink to end in @4.4.7 as well. Renaming the symlink to the name that the script expects helps it to launch it.

Now go back into your working directory, let's say ~, and create your app, this time specifying @4.4.7 as Strapi version:

cd ~
yarn create strapi-starter@4.4.7 my-app next-corporate

It should download the 4.4.7 code and populate the database, images, etc. more or less correctly. It should launch frontend (Next.js app) and backend (Strapi app) with a Project Information box like this (note Strapi 4.4.7):

┌────────────────────┬──────────────────────────────────────────────────┐
│ Time               │ Tue Jan 03 2023 08:43:05 GMT-0500 (Eastern Stan… │
│ Launched in        │ 5789 ms                                          │
│ Environment        │ development                                      │
│ Process PID        │ 57583                                            │
│ Version            │ 4.4.7 (node v16.19.0)                            │
│ Edition            │ Community                                        │
└────────────────────┴──────────────────────────────────────────────────┘

Log in at http://localhost:1337/admin and verify that the Global object is populated, and that there are four Pages objects of which 3 are published. https://localhost:3000/ should load with a few small complaints, but should not WSOD or throw an error.

Now migrate to Strapi back-end current version (v4.5.5 as of this writing), as per the migration guides.

@sntxerror
Copy link

The problem reproduces with TS projects with latest starter

boottrap.js doesn't builds to dist folder.

I've followed this official guide https://docs.strapi.io/dev-docs/typescript#add-typescript-support-to-an-existing-strapi-project

fixed imports and everything works!

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

5 participants