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
The dependency esbuild-style-plugin installs @types/sass: ^1.43.1. This currently resolves to 1.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 seems esbuild-style-plugin is abandoned. g45t345rt/esbuild-style-plugin#28
Potential Solution
I think moving esbuild-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"] to compilerOptions in our tsconfig.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 reference process and the Jest globals. You might need to add additional types depending on your project.
The text was updated successfully, but these errors were encountered:
Problem
The dependency
esbuild-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
Someone opened a PR to remove the types dependency, but it seems
esbuild-style-plugin
is abandoned. g45t345rt/esbuild-style-plugin#28Potential Solution
I think moving
esbuild-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.The text was updated successfully, but these errors were encountered: