W
Wasp-lang14mo ago
TEKK0N

Failed to resolve import "./ext-src/Admin.jsx" from "src/router.tsx". Does the file exist?

Hello community. Ive been testing out mageGPT and am trying to run my generated program locally. Installing Node and NPM as well as making changes to the PATH in order for wasp to run went well. But now i run into this huge chunk of error messages. Im a beginner and dont really understand any of this of the bat but im happy to learn and figure it out along the way. Can someone point me in the right direction here?
No description
50 Replies
matijash
matijash14mo ago
@TEKK0N can you share how your code for AdminPage declaration looks like? maybe when importing you're missing pages/ in path, like you have for other pages above?
TEKK0N
TEKK0NOP14mo ago
thanks @matijash for looking into this, i appreciate your help. I have not made any changes to the files itself. Just unpacked the zip and went from there. There is no file called AdminPage. I was only able to find a file named main.wasp. It mentions AdminPage and says the following:
route AdminRoute { path: "/admin", to: AdminPage } page AdminPage { component: import { Admin } from "@client/Admin.jsx", authRequired: true
No description
matijash
matijash14mo ago
ah I see - then it seems MAGE hasn't actually implemented Admin.jsx, so that's what you need to add. It is not under pages? It might be that it just messed up the import
TEKK0N
TEKK0NOP14mo ago
@matijash okay i missed the pages folder in the previous screen. Here is the content of the pages folder.
No description
MEE6
MEE614mo ago
Wohooo @TEKK0N, you just became a Waspeteer level 1!
TEKK0N
TEKK0NOP14mo ago
so the necessary files have in fact been generated but the program cant access them? How can i fix the import that went wrong? In the error message it says its trying to find the admin file under "./ext-src/Admin.jsx" but the files are in "./src/client/pages/Admin.jsx" Could i manually create a folder called "ext-src" and put the files in there for it to see? Okay i wanted to try this but now im running into a new issue. Apparently it cant connect to the database. Going 'wasp db migrate-dev' tells me i need to run the database first with 'wasp start db' But running 'wasp start db' tells me : 'Nothing to do! You are all good, you are using SQLite which doesn't need to be started.' So if i try again to start the application then with 'wasp start' it puts me back to the first step telling me: 'The database needs to be running in order to execute this command. You can easily start a managed dev database with `wasp start db.'' I checked the docs on this but couldnt find a thing. What am i missing here?
matijash
matijash14mo ago
hmm yeah, if you are on sqlite then no need to run it. Can you past an error you're getting from migrate-dev?
TEKK0N
TEKK0NOP14mo ago
here is the full circle 😄
No description
TEKK0N
TEKK0NOP14mo ago
The database needs to be running in order to execute this command. You can easily start a managed dev database with wasp start db.
Vinny (@Wasp)
Vinny (@Wasp)14mo ago
can you share your wasp file? copy and paste it between three backticks --> `
Vinny (@Wasp)
Vinny (@Wasp)14mo ago
like this
No description
TEKK0N
TEKK0NOP14mo ago
you mean the main.wasp?
Vinny (@Wasp)
Vinny (@Wasp)14mo ago
yep
TEKK0N
TEKK0NOP14mo ago
unfortunately its over 2000 so i cant post it here. but: https://pastebin.com/QrgXpQsL
Pastebin
app VendingMachineLocator { wasp: { version: "^0.11.1" }, tit...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Vinny (@Wasp)
Vinny (@Wasp)14mo ago
weird. try deleting
db: {
prisma: {
clientPreviewFeatures: ["extendedWhereUnique"]
}
},
db: {
prisma: {
clientPreviewFeatures: ["extendedWhereUnique"]
}
},
and then running it again
TEKK0N
TEKK0NOP14mo ago
i deleted it and went for 'wasp db migrate-dev'. Now it says
❌ --- [Error] Your wasp project failed to compile: -------------------------------

- Prisma client generation failed with exit code: 1


❌ --- [Error] Compilation of wasp project failed: --------------------------------

1 errors found
❌ --- [Error] Your wasp project failed to compile: -------------------------------

- Prisma client generation failed with exit code: 1


❌ --- [Error] Compilation of wasp project failed: --------------------------------

1 errors found
wasp-start runs into
❌ --- [Error] Your wasp project failed to compile: -------------------------------

- Prisma client generation failed with exit code: 1


👀 --- [Warning] Your wasp project reported following warnings during compilation: ---

- Your Prisma schema has changed, please run `wasp db migrate-dev` when ready.


❌ --- [Error] Compilation of wasp project failed: --------------------------------

1 errors found
❌ --- [Error] Your wasp project failed to compile: -------------------------------

- Prisma client generation failed with exit code: 1


👀 --- [Warning] Your wasp project reported following warnings during compilation: ---

- Your Prisma schema has changed, please run `wasp db migrate-dev` when ready.


❌ --- [Error] Compilation of wasp project failed: --------------------------------

1 errors found
telling me to wasp db migrate-dev , which i did in step one another circle? 😄 @Vinny (@Wasp) thanks for helping out btw okay i downgraded npm from version 9.3.1 to 8.3.1 but that didnt help. Ive read about it searching this discord for my 'exit code: 1'
MEE6
MEE614mo ago
Wohooo @TEKK0N, you just became a Waspeteer level 2!
TEKK0N
TEKK0NOP14mo ago
It says it cant find 'prisma_fmt_build_bg.wasm' under this path but it exists? Im lost here
No description
No description
TEKK0N
TEKK0NOP14mo ago
can i delete all of the database and repeat the initial setup again? The programm never ran anyway so losing the db wouldnt be a problem
Filip
Filip14mo ago
Ok, let me tru to take a look at it I'll be your support for the day @TEKK0N
TEKK0N
TEKK0NOP14mo ago
much appreciated!
Filip
Filip14mo ago
Do you mind sharing the full project with me? I'll try to reproduce it locally and see where we are from there
TEKK0N
TEKK0NOP14mo ago
not at all, there you go:
Filip
Filip14mo ago
Let's first answer this one The ext-src folder is Wasp's internal implementation detail (inside the code we generate) and you shouldn't be editing it. It's less than ideal that the error message mentions it, and we hope to improve messaging in the future (and prevent it from leaking umimportant implementation details) Anyway, this is an easy fix
Filip
Filip14mo ago
Here's all you need to do:
No description
Filip
Filip14mo ago
Pro tip: Which editor are you using? I recommend instalilng the Wasp plugin for VS Code. It will easily spot errors such as this one
Filip
Filip14mo ago
Filip
Filip14mo ago
Here's a demo
TEKK0N
TEKK0NOP14mo ago
I see, so im removing the ext-src folder i created where i put the content of pages into let me grab this VS Code things, thanks for mentioning!
Filip
Filip14mo ago
Another thing, since MAGE generates code in Wasp (and doesn't always generate correct and complete code), the more you understand Wasp, the easier it will be to use mage. If you're planning to make something serious (and not just play around with it), I highly recommend getting a little more familiar with Wasp by checking out our tutorial: https://wasp-lang.dev/docs/tutorial/create (not necessarily implementing it, just reading around to see how stuff works) (for example, the imports and ext-src thing) Ok, off to the next error
Filip
Filip14mo ago
You're probably getting this one too:
No description
TEKK0N
TEKK0NOP14mo ago
Yes ive been reading some entries there. Ive always been on the fence about better understanding how to code but never got past python tutorials or codecademy. Seeing this mage/wasp topic really reignited my motivation to learn because i feel like i have a project/goal that i want to understand or realize
Filip
Filip14mo ago
What's happening in the error above? Well, Mage (being an overconfident AI) imported a component (AdminPanel) without actually implementing it. There's no easy fix for this one, you'll have to implement it yourself (or with ChatGPTs help :))
TEKK0N
TEKK0NOP14mo ago
im sorry what file did you make the changes too? So none of the admin stuff is there at all? Guess i can find a way to generate this with gpt / mage GPT. Would this work in the building block kinda way im thinking of it? Like "just generate it and put it in" 😄ee Can we "hide" the admin panel part for now to test if the rest of it runs at all?
Filip
Filip14mo ago
Yes, I believe it would I did it, and the database works for me There are other errors on the site, but the DB is ok Here's what I did: 1. Unzipped your project 2. Fixed the admin import issue 3. Commented out the AdminPanel import and Usage in Admin.jsx 4. Ran wasp db migrate-dev 5.. Ran wasp start 6. Went to http://localhost:3000/signup and signed up successfully 7. Then we'll have some other errors, but let's see if this works first 🙂 Try running the entire thing from a fresh folder, and see if the database works
TEKK0N
TEKK0NOP14mo ago
wow okay, let me see..
MEE6
MEE614mo ago
Wohooo @TEKK0N, you just became a Waspeteer level 3!
TEKK0N
TEKK0NOP14mo ago
what file is this again?
Filip
Filip14mo ago
main.wasp
TEKK0N
TEKK0NOP14mo ago
okay failing on step 4 apparently? What am i missing here
No description
TEKK0N
TEKK0NOP14mo ago
the place where the main.wasp file is in is the project root, no?
TEKK0N
TEKK0NOP14mo ago
also in the main.wasp VScode is saying there is a problem with the change we made?
No description
TEKK0N
TEKK0NOP14mo ago
and your step #3 would look like this right? with the import being the "import" and the function being the "usage" you mentioned
No description
TEKK0N
TEKK0NOP14mo ago
Thanks again to everyone for their contributions. But we can leave this thread as it is for now. I have another idea and try to refine the output of MageGPT. I will also do some research and may be back soon with different topics. Again big kudos for being so supportive and helpful!
imbaTman
imbaTman14mo ago
i build almost 10 webapp ......i can say only login/sign up. working LOL
miho
miho14mo ago
The apps need a bit of fixing but they are a great starter 🙃 it's still development, not no-code solution, so some coding knowledge is required
Filip
Filip14mo ago
Welcome!
Busan
Busan14mo ago
I stumle on the same issue, but not sure what is wrong Lol this is cool. Error resolved itself by installing Prism
Vinny (@Wasp)
Vinny (@Wasp)14mo ago
you shouldn't have to install Prisma, as it comes bundled with Wasp already
Vinny (@Wasp)
Vinny (@Wasp)14mo ago
Check out the docs here. They explain it >>https://wasp-lang.dev/docs/project/dependencies
Dependencies | Wasp
Specifying npm dependencies in Wasp project is done via the dependencies field in the app declaration, in the following way:
Want results from more Discord servers?
Add your server