-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Cannot find module X... #10567
Comments
How are you building the gulp task? |
Here is an example https://github.com/MCKRUZ/GulpTypescriptError |
running tsc from your repo gives me these errors: c:\test\10567\GulpTypescriptError\mtm-ng2-gulp-tasks\mtm-ng2-gulp-tasks>tsc --v
Version 2.1.0-dev.20160829
c:\test\10567\GulpTypescriptError\mtm-ng2-gulp-tasks\mtm-ng2-gulp-tasks>tsc
1 export * from './utils/momentum.utils.ts';
~~~~~~~~~~~~~~~~~~~~~~~~~~~
mtm-ng2-gulp-tasks.ts(1,15): error TS2691: An import path cannot end with a '.ts' extension. Consider importing './utils/momentum.utils' instead.
2 export * from './config/momentum.config.interfaces.ts';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mtm-ng2-gulp-tasks.ts(2,15): error TS2691: An import path cannot end with a '.ts' extension. Consider importing './config/momentum.config.interfaces' instead.
3 export * from './config/momentum.config.methods.ts';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mtm-ng2-gulp-tasks.ts(3,15): error TS2691: An import path cannot end with a '.ts' extension. Consider importing './config/momentum.config.methods' instead. the errors look right to me. |
If you run it in studio it compiles just fine. It doesn't have anything to do with the error that I was originally talking about. Try running it through studio. |
the error is introduced in TS 2.0.2 (post TS 2.0 beta). you should not be requiring a ".ts" file as the file does not exist at runtime, and the compiler will not rewrite this import to I get the same build errors in VS with latest TS drop (has not shipped yet). so looks like the original issue will be fixed with the next release. |
Right I get the error that you're referencing. I actually just fixed it if you want to pull down the latest. What I'm saying is that I don't think the original error has anything to do with that b/c I'm still seeing the original problem after I fix it. Are you saying you don't see the original problem in the new build? |
nope. fixing the 3 errors leads to a successful build for me from VS and on the commandline. |
i am gonna mark this as fixed in TS 2.0 RC for now. feel free to reopen if you see it after installing the next TS version. |
Sorry sorry...this is my bad. I accidentally uploaded the file with the fix. Try pulling again and running it. If you look at the task runner explorer it will show an error. |
the line you're looking for is line 5 in gulpfile.ts. Where it references not the full path. When I do it like this the task runner explorer doesn't pick up any of the tasks. |
were you able to get it to error? |
Sorry, i did not have time to try it again after your last post. |
OK tried again. looks like fixed for me. i am gonna mark it as fixed. if you feel this still an issue please reopen and i would appreciate it if you can provide some additional information why you believe this is a TS issue and not caused by other parts of the tool chain. |
What version of typescript are you on? From: Mohamed Hegazy notifications@github.com OK tried again. looks like fixed for me. i am gonna mark it as fixed. if you feel this still an issue please reopen and i would appreciate it if you can provide some additional information why you believe this is a TS issue and not caused by other parts of the tool chain. — |
TypeScript Version: 1.8.0
Code
I have two projects. One I'm building general gulp tasks in. One I'm consuming those general gulp tasks.
Project 1 contains a class called TasksTools that lives in a file called tasksTools.ts
it also has a definitions file that lives in a file called index.d.ts
so I wrap these up and make an NPM library. Then I import that lib into project 2
Here is my gulp file gulpfile.ts
Now when I try to run this I get the error
Failed to run "C:\TFS\Dev\Momentum.Torques\Client\Gulp\mtm-ng2-gulp-tasks\mtm-ng2-gulp-tasks-test\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
module.js:442
throw err;
^
Error: Cannot find module '@mtm/mtm-ng2-gulp-tasks'
Expected behavior:
I expect that this would work
Actual behavior:
It did not work
The text was updated successfully, but these errors were encountered: