Closed
Description
TypeScript Version: 3.1.0-dev.20180717
Search Terms: #25517
Code
#!/bin/bash
set -x
rm -rf node_modules package*.json import-json.ts bundle*js
npm init --yes
npm add typescript@2.9.2 libphonenumber-js@1.2.14
cat > 'import-json.ts' <<EOF
import phoneMetadata from 'libphonenumber-js/metadata.mobile.json';
console.log(phoneMetadata)
EOF
npx tsc --esModuleInterop --resolveJsonModule --outFile bundle-2.9.2.js --module amd --moduleResolution node import-json.ts
npm add typescript@next
npx tsc --version
npx tsc --esModuleInterop --resolveJsonModule --outFile bundle-next.js --module amd --moduleResolution node import-json.ts
Expected behavior:
The code that used to work just fine in 2.9 still works in 3.x without generating compilation errors.
Actual behavior:
The resolution of #25517 (which I'm really not happy with) not only did not fix the issue reported, it also broke our existing code referencing a json file from the libphonenumber-js
module.
Playground Link:
Related Issues: #25517
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment