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?
50 Replies
@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?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
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@matijash okay i missed the pages folder in the previous screen. Here is the content of the pages folder.
Wohooo @TEKK0N, you just became a Waspeteer level 1!
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?
hmm yeah, if you are on sqlite then no need to run it. Can you past an error you're getting from migrate-dev?
here is the full circle 😄
The database needs to be running in order to execute this command. You can easily start a managed dev database with
wasp start db
.can you share your wasp file?
copy and paste it between three backticks --> `
like this
you mean the main.wasp?
yep
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.
weird. try deleting
and then running it again
i deleted it and went for 'wasp db migrate-dev'. Now it says
wasp-start runs into
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'Wohooo @TEKK0N, you just became a Waspeteer level 2!
It says it cant find 'prisma_fmt_build_bg.wasm' under this path but it exists?
Im lost here
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
Ok, let me tru to take a look at it
I'll be your support for the day @TEKK0N
much appreciated!
Do you mind sharing the full project with me? I'll try to reproduce it locally
and see where we are from there
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 fixHere's all you need to do:
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
Here's a demo
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!
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
You're probably getting this one too:
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
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 :))
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?
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 workswow okay, let me see..
Wohooo @TEKK0N, you just became a Waspeteer level 3!
what file is this again?
main.wasp
okay failing on step 4 apparently? What am i missing here
the place where the main.wasp file is in is the project root, no?
also in the main.wasp VScode is saying there is a problem with the change we made?
and your step #3 would look like this right?
with the import being the "import" and the function being the "usage" you mentioned
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!
i build almost 10 webapp ......i can say only login/sign up. working LOL
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
Welcome!
I stumle on the same issue, but not sure what is wrong
Lol this is cool. Error resolved itself by installing Prism
you shouldn't have to install Prisma, as it comes bundled with Wasp already
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: