-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 "import { NameValueUnits } from" #4076
Comments
In the branch AddVS15 of https://github.com/kevinpas/Klib6 there is a Tools folder. In that folder there is a vs 15 project that should be used. |
This is a node issue. it can not find a module "NameValue" the issue is that you are using module "NameValue" without a relative path, which tells node to find a package with this name. in NameValueUnits.ts change import { NameValue } from "NameValue"; to import { NameValue } from "./NameValue"; I understand that you wanted the compiler to flag this instead figuring it out yourself. If you have a proposal on how to do that we would be open to discussing it. |
It is a difficult problem. But it doesn't seem to be the natural intent of the new import keyword. I have no suggestions other than passing import another parameter telling it the callers perspective. |
Merged my branch back into master. |
this should be working correctly today. please reopen if this is not the case. |
Note: I am not trying to get help fixing my code. I am only reporting what I think is a bug in typescript.
See branch "AddVS15" of https://github.com/kevinpas/Klib6
There are two imports in the startup file "Klib6/Tests/Core/CoreTests.ts". If you comment out the second one you can successfully run and debug/step through the tests in the startup file.
If you uncomment the second import and uncomment the two lines near the bottom:
//var units = "mm";
//var nameValueUnits = new NameValueUnits( name, value, units );
when you try to run it you get the exception (on win7):
Debugger listening on port 5858
module.js:338
throw err;
^
Error: Cannot find module 'NameValue'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (C:\ ... \Git\GitHub\Klib6\Source\Core
\NameValueUnits.js:46:19)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
Press any key to continue...
The text was updated successfully, but these errors were encountered: