main.wasp.ts related
OS: Linux Mint
Context: Recently made a new Wasp (v0.16.2) project. I set it up first with
main.wasp
before changing it to main.wasp.ts
. Followed the wasp-ts-config instructions carefully.
Problem: import { App } from 'wasp-config'
has no exported member 'App'. When I used go-to-definition on 'wasp-config'
, it sends me to run.d.ts
file. Is this normal?19 Replies
Hi @isaiah. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I apologize, but the knowledge sources provided do not contain enough information to directly answer your specific question about
main.wasp.ts
, the wasp-config
import, or the behavior you're experiencing with go-to-definition. The documents mainly focus on the standard main.wasp
file structure and some general IDE support issues for Wasp, but they don't cover the specific TypeScript configuration you're asking about.
However, I can provide some general information about Wasp's project structure and IDE support based on the available sources:
1. The standard Wasp project structure typically includes a main.wasp
file, not a main.wasp.ts
file. Docs > Tutorial > 2. Project Structure shows the default structure and mentions that main.wasp
is the app's definition file.
2. Wasp does support TypeScript out of the box, but the documentation doesn't mention a main.wasp.ts
file specifically. Docs > Tutorial > 2. Project Structure states: "Wasp supports TypeScript out of the box, but you are free to choose between or mix JavaScript and TypeScript as you see fit."
3. There are ongoing efforts to improve IDE support for Wasp projects, including better integration with TypeScript. However, these improvements are still in progress and may not be fully implemented yet. Github Issue: Proper IDE support for Wasp projects discusses some of these efforts.
Given that your setup seems to be different from the standard Wasp configuration described in the documentation, and considering the ongoing work on IDE support, it's possible that you're encountering an issue related to these factors. You might want to check the official Wasp documentation or reach out to the Wasp community for more specific guidance on using main.wasp.ts
and the wasp-config
import.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @isaiah, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@kapa.ai Tell me about
wasp ts-setup
cli command.Let me check the knowledge base for you again. One moment! :books:
----------------------
The knowledge sources provided don't contain specific information about a
wasp ts-setup
CLI command. The available documentation on Wasp CLI commands doesn't mention this particular command.
However, I can provide some general information about Wasp's CLI and TypeScript support:
1. Wasp supports TypeScript out of the box, as mentioned in the Docs > Tutorial > 2. Project Structure: "Wasp supports TypeScript out of the box, but you are free to choose between or mix JavaScript and TypeScript as you see fit."
2. The Docs > General > CLI Reference provides an overview of Wasp CLI commands, arguments, and options. However, it doesn't list a ts-setup
command.
3. There are ongoing efforts to improve TypeScript support and configuration in Wasp projects, as evidenced by several GitHub issues discussing TypeScript-related topics.
If you're looking for information about setting up TypeScript in a Wasp project, it might be worth checking the latest Wasp documentation or reaching out to the Wasp community directly. The ts-setup
command you're asking about might be a recent addition or a proposed feature that isn't yet reflected in the provided knowledge sources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @isaiah, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?After running the
ts-setup
command, you should see wasp-config
listed in your devDependencies. Confirm that it’s present, then run npm install
and reset the TS language server in your editor, via the Command Palette.Thanks, that fixed it. I always thought
wasp start
run npm install
before starting the server.
Guess: Because of error during parsing it exited before running npm install?It does run install if you did clean before 🤔
Doesn’t for me with the TS config: https://discord.com/channels/686873244791210014/1340519440944595036/1341139540991279224
@Filip might wanna check out this issue. sounds like a potential bug?
I'll check it out in a day or two, since it doesn't seem urgent
@isaiah sorry for the troubles!
I just created a fresh, default app and checked
wasp clean && wasp start
worked as expected. I migrated to the TS config and can confirm that the same command sequence fails with the "This is not the tsc command you are looking for" error message. A clean restart now requires wasp clean && npm install && wasp start
I found this after converting to the wasp.ts. I ran into this same issue and solved it with clean, install, start as well.
Thanks for reporting, @hadanator ! Time to create an issue
Another user report posted and still didn't see an issue, so created one: https://github.com/wasp-lang/wasp/issues/2809
GitHub
wasp start
behaviour changes when using TypeScript config · Issu...Describe the bug When using TS configuration, wasp start throws the following error after running wasp clean, unless npm install is executed in-between those commands: 🐝 --- Starting compilation an...
Same issue here
Yes, your post is the one I linked to 😄
Oh, oops, didn't click it to see where it went 🙃
Thanks!
Great thing you described how to reproduce it because I now realize that this is expected (not desirable, of course, but expected). I should have made it clearer in the docs.
At the moment, users are supposed to run
wasp ts-setup
after wasp clean
.
This is, of course, dreadful DX. But since the TS spec is still an experimental feature, we left it like that. I obviously forgot to communicate it properly though.
Thanks for the issue @genyus ! I'll find a way to warn users about this quirk when I get back to the office and solve it then. We already have an issue for removing the need for ts-setup
, so soon we'll have normal DX with the TS spec.I ran
ts-setup
after I did clean (I think, can't remember now as it's 5am 😅). I think it's communicated okay in the docs for being experimental
thinking about it at a more reasonable time, yeah I probably just forgot to run it a bunch. I've set it up so I can npm run rw
and it'll wasp clear && wasp ts-setup && wasp db migrate-dev && wasp start
so I won't forget in the future. Thanks!Great thinking @Zeke !
But we really should get rid of that
ts-setup
thing ASAP