You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Uninstalled optional peer dependencies such as 'pug' causes the following error during type checking with tsc
error TS2307: Cannot find module 'pug' or its corresponding type declarations.
> import type { Options as PugOptions } from 'pug';
This issue did not occur in svelte-preprocess v5.1.4 because @types/pug was installed as a direct dependency. Since v6, that type dependency has been removed, leading to errors when pug is not installed.
The issue is also applicable for other optional peer dependencies, such as @babel/core. Which can be remedied by having @types/babel__core as dependency.
Logs
To Reproduce
With pnpm, create a typescript project with esbuild.config.ts that imports sveltePreprocess.
Make sure that skipLibCheck in tsconfig.json is not set to false.
Run pnpm tsc
Expected behavior
No errors should be thrown when pug is not installed, as it is an optional dependency.
Stacktraces
Information about your project:
Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)
Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)
svelte-preprocess version: 6.0.3
Whether your project uses Webpack or Rollup:
Additional context
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Uninstalled optional peer dependencies such as 'pug' causes the following error during type checking with
tsc
This issue did not occur in svelte-preprocess v5.1.4 because @types/pug was installed as a direct dependency. Since v6, that type dependency has been removed, leading to errors when pug is not installed.
The issue is also applicable for other optional peer dependencies, such as
@babel/core
. Which can be remedied by having@types/babel__core
as dependency.Logs
To Reproduce
esbuild.config.ts
that importssveltePreprocess
.skipLibCheck
intsconfig.json
is not set tofalse
.pnpm tsc
Expected behavior
No errors should be thrown when pug is not installed, as it is an optional dependency.
Stacktraces
Information about your project:
Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)
Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)
svelte-preprocess
version: 6.0.3Whether your project uses Webpack or Rollup:
Additional context
The text was updated successfully, but these errors were encountered: