-
Notifications
You must be signed in to change notification settings - Fork 213
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
Typescript not setup correctly in Build a React App
#1171
Comments
Ran into similar problems myself, following along with the They actually added an easier way to do this in the latest release > deno init --npm vite However this template does not create a The command I had the most joy with is this, using vite-extra templates
Should give you what you need, and actually includes a Not sure if the current tutorial needs updating, since it includes a lot of the extra tools and configs that defeat the purpose of actually using deno over npm 🤷 Hope this helps anyway, let me know if you get it working |
I've updated the tutorial to mention that the create-vite app will need you to disable the deno extension, and I've created a react-vite template that has a deno.json which can be used in place of create-vite and written up a tutorial for that too - PR here: #1195 Sadly we've been told that create-vite-extra will not be supported for much longer so we're not recommending folks use that right now. |
@thisisjofrank I read through the PR. Doesn't what is written at https://github.com/denoland/docs/pull/1195/files#diff-93e344d2181688d19076495dd38be89a436d5145be424df3ff668d49986fb112R47 (line 47 if the link does not work) mean that essentially you are setting up a node project and you are using vscodes' built-in TS server for error checking and disabling deno fully? Doesn't that also mean that:
I can't quite follow what the adventage is to use Deno at all in this instsance? I am not particularly versed in Deno yet, so please correct me if i am wrong with this. Thanks fof writing a new tutorial! |
@ZweiEuro disabling the extension will not disable Deno tools, it will just stop the LSP from trying to lint your code in the editor (and therefore will stop showing errors when things like directly importing svgs or having missing types). You will still be able to run deno lint and deno fmt etc and run the project with Deno, compile the typescript with Deno and use Deno APIs in the project, but you will not get the autocomplete suggestions for Deno specific APIs in the editor, and you'd be relying on the built in TS LSP for type checking etc. |
File:
runtime/tutorials/how_to_with_npm/react.md
Running the example with a fresh VSCode installation and in a new folder:
deno task dev
runs fine, but deno is disabled.Running deno: enable in VSCode does shows the following:
There is no
deno.json
fileShould these things be setup correctly?
The text was updated successfully, but these errors were encountered: