Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Handle missing sapper root element #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lovasoa
Copy link

@lovasoa lovasoa commented May 6, 2021

Before this change, upgrading this project to typescript and enabling strict null checks would throw the following error :

> @rollup/plugin-typescript TS2322: Type 'Element | null' is not assignable to type 'Node'.
  Type 'null' is not assignable to type 'Node'.

4   target: document.querySelector("#sapper"),
    ~~~~~~

  src/node_modules/@sapper/index.d.ts:20:32
    20  export function start(opts: { target: Node }): Promise<void>;
                                      ~~~~~~
    The expected type comes from property 'target' which is declared here on type '{ target: Node; }'

Before this change, upgrading this project to typescript and enabling strict null checks would throw the following error : 

```
> @rollup/plugin-typescript TS2322: Type 'Element | null' is not assignable to type 'Node'.
  Type 'null' is not assignable to type 'Node'.

4   target: document.querySelector("#sapper"),
    ~~~~~~

  src/node_modules/@sapper/index.d.ts:20:32
    20  export function start(opts: { target: Node }): Promise<void>;
                                      ~~~~~~
    The expected type comes from property 'target' which is declared here on type '{ target: Node; }'
```
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant