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

When running wasp db migrate-dev # init the db on a MAGE project [Error] Migrate dev failed: #1579

Closed
clickbrain opened this issue Nov 18, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@clickbrain
Copy link

Describe the bug
When running wasp db migrate-dev # init the db on a MAGE project
[Error] Migrate dev failed:
Unknown migrate arg(s): # init the db

To Reproduce
create Mage app
Put files in folder from zip
Run:
wasp db migrate-dev # init the db

Expected behavior
Setup the app

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • MacOS - Terminal
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Full log of what ran:
wasp db migrate-dev # init the db

🐝 --- Compiling wasp project... --------------------------------------------------

🐝 --- Starting npm install... ----------------------------------------------------

...Still installing npm dependencies!

...Installation going great - we'll get there soon!

...The installation is taking a while, but we'll get there!

...Yup, still not done installing.

...We're getting closer and closer, everything will be installed soon!

...Still waiting for the installation to finish? You should! We got too far to give up now!

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

[Server] > server@0.0.0 postinstall
[Server] > patch-package
[Server]
[Server] patch-package 6.5.1
[Server] Applying patches...
[Server!] No patch files found
[Server]
[Server] added 403 packages, and audited 404 packages in 3m
[Server]
[Server] 114 packages are looking for funding
[Server] run npm fund for details
[Server]
[Server] 4 moderate severity vulnerabilities
[Server]
[Server] To address all issues (including breaking changes), run:
[Server] npm audit fix --force
[Server]
[Server] Run npm audit for details.

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

...You've been waiting so patiently, just wait a little longer (for the installation to finish)...

[Client] added 460 packages, and audited 461 packages in 4m
[Client]
[Client] 103 packages are looking for funding
[Client] run npm fund for details
[Client]
[Client] found 0 vulnerabilities
✅ --- Successfully completed npm install. ----------------------------------------

🐝 --- Setting up database... -----------------------------------------------------

[Db!] Error: P1003
[Db!]
[Db!] Database dev.db does not exist at /Users/bradn/Documents/AI/Wasp/MarkdownTasks/.wasp/out/db/./dev.db
[Db!]
[Server] Environment variables loaded from .env
[Server] Prisma schema loaded from ../db/schema.prisma
[Server]
[Server] added 2 packages, and audited 116 packages in 759ms
[Server]
[Server] 14 packages are looking for funding
[Server] run npm fund for details
[Server]
[Server] found 0 vulnerabilities
[Server]
[Server] added 2 packages, and audited 118 packages in 617ms
[Server]
[Server] 14 packages are looking for funding
[Server] run npm fund for details
[Server]
[Server] found 0 vulnerabilities
[Server]
[Server] ✔ Installed the @prisma/client and prisma packages in your project
[Server]
[Server] ✔ Generated Prisma Client (4.16.2 | library) to ./node_modules/.prisma/client in 87ms
[Server] You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
[Server] [Server] import { PrismaClient } from './node_modules/.prisma/client' [Server] const prisma = new PrismaClient() [Server]
[Client] Environment variables loaded from .env
[Client] Prisma schema loaded from ../db/schema.prisma
[Client]
[Client] ✔ Generated Prisma Client (4.16.2 | library) to ./../web-app/node_modules/.prisma/client in 81ms
[Client] You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
[Client] [Client] import { PrismaClient } from '../web-app/node_modules/.prisma/client' [Client] const prisma = new PrismaClient() [Client]
✅ --- Database successfully set up. ----------------------------------------------

✅ --- Your wasp project has successfully compiled. -------------------------------

🐝 --- Starting database migration... ---------------------------------------------

❌ --- [Error] Migrate dev failed: ------------------------------------------------

Unknown migrate arg(s): # init the db
bradn@RE315 MarkdownTasks % >....
/pris.ly/d/client
[Client] [Client] import { PrismaClient } from '../web-app/node_modules/.prisma/client' [Client] const prisma = new PrismaClient() [Client]
✅ --- Database successfully set up. ----------------------------------------------

✅ --- Your wasp project has successfully compiled. -------------------------------

🐝 --- Starting database migration... ---------------------------------------------

❌ --- [Error] Migrate dev failed: ------------------------------------------------

Unknown migrate arg(s): # init the db

@Martinsos
Copy link
Member

@clickbrain this is quite weird, so it seems you ran wasp db migrate-dev # init the db and then got the error due to # init the db part. That part is a comment, and it shouldn't cause an error though! It doesn't cause an error for me when trying it out.

So, just try running it without that part, so only:

wasp db migrate-dev

I am curious though why that happens for you.

@Martinsos Martinsos added the bug Something isn't working label Nov 20, 2023
@clickbrain
Copy link
Author

I did try it without the comment the first time I ran it and still had the errors, but this time ran it without the comment and it worked.

Now when I run wasp start, I get these errors in the browser.

[plugin:vite:import-analysis] Failed to resolve import "./ext-src/pages/DashboardPage.jsx" from "src/router.tsx". Does the file exist?
/Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-q7rkb/.wasp/out/web-app/src/router.tsx:15:30
7 | import LoginPage from './ext-src/pages/auth/Login.jsx';
8 | import SignupPage from './ext-src/pages/auth/Signup.jsx';
9 | import { DashboardPage } from './ext-src/pages/DashboardPage.jsx';
| ^
10 | import { File as FilePage } from './ext-src/pages/File.jsx';
11 | export const routes = {
at formatError (file:///Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-q7rkb/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44062:46)
at TransformContext.error (file:///Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-q7rkb/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44058:19)
at normalizeUrl (file:///Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-q7rkb/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41844:33)
at async file:///Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-q7rkb/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41998:47
at async Promise.all (index 8)
at async TransformContext.transform (file:///Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-q7rkb/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41914:13)
at async Object.transform (file:///Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-q7rkb/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44352:30)
at async loadAndTransform (file:///Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-q7rkb/.wasp/out/web-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55026:29)
at async viteTransformMiddleware (file:///Users/bradn/Documents/AI/Wasp/MarkdownTasks/LogSeqTasks1-

@clickbrain
Copy link
Author

I don't see a router.jsx file in src. So it must not have created it. I'll come back and try this again later and will go to Discord if I have difficulty.

@Martinsos
Copy link
Member

Ok then we fixed that issue! I already made a commit to remove that comment from the instructions, since it is causing people problems.

As for the Dashboard error: It seems like GPT introduced an error into the app as it was generating it!
Specifically, it can't find "DadshboardPage".
Look into the files of the generated app -> is there a DashboardPage under client/pages/?
What is likely that it is instead just called Dashboard and GPT got confused and tried to reference it as DashboardPage later at some point -> probably in .wasp file.
So you got to make sure those are all in sync.

NOTE: Mage is currently not at the level where it is easy to use for non-devs, it is more of a "smart" project starter for developers -> because it can make mistakes and can get lost if project is bigger, so unless app is as simple as TodoApp or MyPlants example, it requires a developer to fix it up and get it working.

I will close this issue, and yeah feel free to ask more questions on Discord especially if about Mage since those are not really bug but just GPT making mistakes (which is kind of normal).

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

2 participants