Bug Report
🔎 Search Terms
- native modules alias relative paths
- Relative references must start with either "/", "./", or "../".
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about declaration files
⏯ Playground Link
N/A (behavior is documented)
💻 Code
Related frustrations have been posted many times before - so I've hesitated to post this:
#16577
#13422
#28288
#42151
My case, and workaround, are documented here: https://stackoverflow.com/questions/67725840/how-can-i-use-threejs-es6-native-modules-with-typescript/73575993#73575993
🙁 Actual behavior
- The Declaration File must be included with an alias, e.g.
import * as THREE from 'three'
- es6 modules require extensions, which the alias does not allow. TypeScript does and will not support URL rewriting.
- As a result, I cannot use Declaration Files + TypeScript without importing additional software
🙂 Expected behavior
There could be multiple possible solutions here:
-
Just document it better, here: https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html If this was described as a known limitation, it would have saved me half a day.
-
Support aliases with extensions in one of two ways:
a) Allow the alias itself to be of the final expected form ./js/lib/three.module.js
b) Allow some sort of a custom mapping, which I can use to tell tsc to look for an .d.ts alias three when it sees ./js/lib/three.module.js
Thanks in advance!
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
⏯ Playground Link
N/A (behavior is documented)
💻 Code
Related frustrations have been posted many times before - so I've hesitated to post this:
#16577
#13422
#28288
#42151
My case, and workaround, are documented here: https://stackoverflow.com/questions/67725840/how-can-i-use-threejs-es6-native-modules-with-typescript/73575993#73575993
🙁 Actual behavior
import * as THREE from 'three'🙂 Expected behavior
There could be multiple possible solutions here:
Just document it better, here: https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html If this was described as a known limitation, it would have saved me half a day.
Support aliases with extensions in one of two ways:
a) Allow the alias itself to be of the final expected form
./js/lib/three.module.jsb) Allow some sort of a custom mapping, which I can use to tell tsc to look for an
.d.tsaliasthreewhen it sees./js/lib/three.module.jsThanks in advance!