Weird vscode bug
In main.wasp, I get this vscode error showing that there is no export member on only these 2 queries.
I can use them in frontend components, it is not a showstopper but kinda annoying that the error persists even after closing/reopening vscode.
13 Replies
Hi @fustuk.. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
This issue you're experiencing in VSCode with Wasp is a known problem that can occur due to inconsistencies between TypeScript configuration files. It's not actually a bug in your code, but rather an IDE reporting issue.
The problem stems from discrepancies between the
tsconfig.json
files used by your project and the ones generated by Wasp. This can cause the IDE to report false-positive errors, such as claiming that certain exports don't exist when they actually do.
Here are a few things you can try to mitigate this issue:
1. Run wasp clean
and restart your project. This might help refresh the generated files and resolve the inconsistency.
2. Make sure you're using the latest version of Wasp, as newer versions may have improvements in type generation and IDE integration.
3. If the problem persists, you might need to wait for further improvements in Wasp's TypeScript integration. The Wasp team is aware of these issues and is working on improving the consistency between the tsconfig.json
files.
It's worth noting that, as you've observed, these errors don't actually prevent your code from working correctly. They're just annoying IDE warnings.
For more context on this issue, you can refer to this GitHub issue which discusses the problem in detail.
If you continue to face issues or if this doesn't resolve your problem, you might want to reach out to the Wasp community on their Discord channel for more specific help.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @fustuk., 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?those 3 are my only .js files everything else is .ts maybe that is the issue?
I've ran wasp clean and restarted project and IDE
@sodic one for you to consider
@fustuk. maybe remove the
.js
extension from the import?I've tried removing it, still the same, also the import above it also has the .js in it but its fine
I'd be curious to know what's different about the exports in creator.js. If you try moving functions between your two .js files (e.g.
verifyTelegramChannel
and getLandingPages
, does the behaviour still persist?no it does not, the IDE thinks the second .js file doesnt exist for some reason, no errors in the console or terminal, but it's annoying seeing main.wasp file glow red lol
No ignore rules singling out that file or anything? Super weird. Maybe just rename/create a new creators.js file and move on 😅
Wohooo @genyus, you just became a Waspeteer level 3!
I will eventually if we dont resolve it, I just want to not deal with this again in the future 😄
Hard to triage without any visibility, but have you modified your tsconfig.json, by chance?
Hey @fustuk. Have you tried restarting the TS language server?
no, but somehow it fixed itself I couldnt figure out how :/
I think I pushed my changes then reopened the ide and maybe ran wasp clean somewhere in the middle of it
It happened to me before, but only thing that fixed was restarting vscode