New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NG4 build error on import #1054
Comments
Hello, How are you importing flatpickr? I'll see if including |
I've included Thank you. |
I've just update to 3.1.4 but it does not work. I've found a workaround by reading : https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Module%20Resolution.md I've added into tsconfig.app.json in 'paths' property. |
I have the same issue, I've just updated and we're running Angular CLI (which internally uses webpack), using the latest typescript version (2.5.3) and we're importing like:
and during build we get ERROR in C:/Users/andre/Source/ui-guidelines/node_modules/flatpickr/src/types/instance.ts (4,48): Cannot find module 'utils/formatting'. I do get the same errors when building with a "normal" webpack build, not using Angular CLI. VSCode also gives the same warnings if I open the files in question. |
@Phivan those paths are based on the I'll see what can be done. |
Your last commit after v4 release, looks intersting, where you added
tsconfig to dist batch script, i didnt have time to check it out today. Can
do it tomorrow
Den 10 okt. 2017 19:49 skrev "Gregory" <notifications@github.com>:
… @Phivan <https://github.com/phivan> those paths are based on the baseUrl
option in the tsconfig, and looks like typescript does not take it into
consideration.
I'll see what can be done.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1054 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGY6lLhLme9Xl0WY_SGk9O68Jyi3fM-Jks5sq64MgaJpZM4PybVv>
.
|
Same here, getting the same errors on build. Looking forward to see this fixed. |
Same problem here, previous version was working fine. After the upgrade the error occurred.
The last version that works for me fine is 3.0.7. Everything above throws the given error. |
@chmln I believe this can be resolved by using imports relative to the file rather than relative to the baseUrl configuration option. For example in "types/options.ts" |
@vince-koch indeed, it can be resolved that way. But it is not a solution, it is a workaround. I will see if typescript folks can do something about this. Please use the workaround posted by @Phivan meanwhile. |
@chmln and @Phivan. the same for other errors like "flatpickr/src/plugins/weekSelect/weekSelect.ts" |
i have the same error any one has a solution :Error: node_modules/flatpickr/src/types/instance.ts:4:48 - error TS2307: Cannot find module 'utils/formatting' or its corresponding type declarations. 4 import { RevFormat, Formats, TokenRegex } from "utils/formatting"; |
Flatpickr version :3.1.3"
node : v8.6.0
npm: 5.3.0
ngcli: 1.3.2
When I build my Angular 4 app using :
I get these errors :
It come from these lines
import { getWeek } from "utils/dates";
import { RevFormat, Formats, TokenRegex } from "utils/formatting";
I think that the problem is paths are wrong. Am I wrong ?
The text was updated successfully, but these errors were encountered: