Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2k
Description
Problem
The dependencyesbuild-style-plugin installs@types/sass: ^1.43.1. This currently resolves to1.45.0 which is a deprecation version that doesn't actually include any type files. In our project, this was causing typescript errors because it is trying to load the types from@types/sass globally since we didn't change a default tsconfig option.
The error message we received
error TS2688: Cannot find type definition file for 'sass'. The file is in the program because: Entry point for implicit type library 'sass'Someone opened a PR to remove the types dependency, but it seemsesbuild-style-plugin is abandoned.g45t345rt/esbuild-style-plugin#28
Potential Solution
I think movingesbuild-style-plugin to a dev dependency will prevent others from running into this. I'm not sure why it would need to be a regular dependency as there are other esbuild plugins as dev dependencies already in plotly.js.
Workaround/Fix for users
For anybody looking for a fix that doesn't need an update from plotly, we needed to add"types": ["node", "jest"] tocompilerOptions in ourtsconfig.json. This prevents the default behavior of looking at every@types module for global declarations which was causing the type error. In our case we only referenceprocess and the Jest globals. You might need to add additional types depending on your project.