-
Notifications
You must be signed in to change notification settings - Fork 71
Cannot see typing newly generated file (build error) #33
Comments
Heja, yeah its a known issue and I haven't found a way to prevent that yet. It sadly is kind of a chicken-egg situation, IIRC.
as soon as a typing for a file is found this will get preferred by typescript. However as long as that is not the case this definition is used and the error might go away! |
This definition work for Edit - this declaration will work:
|
@jurosh That didn't work for me for some reason, but after stumbling on this issue microsoft/TypeScript#6615 it turns out that if you're using Typescript 2.0 just doing this works:
Although it does seem to add ~10 seconds to my build. |
Hi, any progress on this? I do not like the I guess I'll have to do one extra failing "pre-build" that will generate .scss.d.ts files and a second hot and checked build afterwards. Not very sexy though :-/. |
My approach for fixing this was to keep the generated files version controlled. Not ideal, and could theoretically permit some errors to get through CI, but it's practical enough for now. |
I asked a semi-related question on Stack Overflow. It's possible that by both writing the typings to a file and outputting the typings as part of the loader, the initial build might work. |
solving this would make this library a lot more useful! |
unfortunately I had to ditch this library, and use https://github.com/Quramy/typed-css-modules using the CLI to create typed css modules seems more flexible as I can run it in a |
I just ran into this when I cloned my project's repo anew and tried to compile my app. Others suggest that just re-running the build-process fixes the problem, but that doesn't work in my case, the type definition files are still missing and the build fails. Has anyone here gotten closer to a solution? |
Configuration:
Steps to reproduce:
import * as css from './test.css';
We can watch that
test.css.d.ts
was generated after we addedimport
and ts loader see this as error.After re-running webpack error is gone.
TS-loader needs to wait till
*.css.d.ts
files are generated - somehow (not sure if it's possible), but it's essential to make this loader totally awesome :)If there is some hotfix, or I am using configuration incorrectly please give me tips how to apply fix - Thanks.
The text was updated successfully, but these errors were encountered: