Cannot assign number to "number | undefined" when using package.json
Hi. I'm having odd behavior when using a newly created Vite vanilla TypeScript template using
but the lsp shows error on the
Here is how I reproduce:
1. Run
2. Run
3. Add the Excalibur dependency with
4. Replace the contents of main.ts with
5. At this point I have errors on
6. Delete the package.json and create a deno.json file with this content:
6. Fix the import to
7: Errors are gone.
deno init --npm vite@latest. Right after initialization I'm installing the game library https://www.npmjs.com/package/excalibur. A game object in the engine is written like this:but the lsp shows error on the
width and height properties. It saysType 'number' is not assignable to type 'undefined'.though they are both a type of
number | undefined. If I replace the package.json file with a deno.json file and reinstalls the node_modules it all works. I have tested on two machines. Is it a bug or am I missing something?Here is how I reproduce:
1. Run
deno init --npm vite@latest test-exc, select Vanilla, select TypeScript2. Run
deno install inside the project.3. Add the Excalibur dependency with
deno add npm:excalibur4. Replace the contents of main.ts with
5. At this point I have errors on
width and height.6. Delete the package.json and create a deno.json file with this content:
6. Fix the import to
npm:excalibur, remove the node_modules folder, and reinstall with deno install.7: Errors are gone.
