Repository: TypeScript
Issue: typescript shows error about import with new URL
Labels: Bug

# Bug Report

### 🔎 Search Terms

new URL, import, dynamic import

### 🕗 Version & Regression Information

- This is a crash
- TypeScript 4.1.5


### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?#code/MYewdgzgLgBArgJwDYwLwzAUwO4wKoBKAMgBQDkA9AGYCWSmAdAFYRkA0MNAtgA4gJQGXTFACGDREgCUAKBnc+AkpNkzMAD0WwA3gF8ZQA)

### 💻 Code

```ts
const url = new URL('/file.js', import.meta.url)

import(url)

export {}
```

### 🙁 Actual behavior

1. TypeScript shows an error: "Dynamic import's specifier must be of type 'string', but here has type 'URL'.ts(7036)" 
2. Intellisense and type checking stop working in VSCode


### 🙂 Expected behavior

1. TypeScript shows no error
2. Intellisense and type checking are working normally in VSCode


Stacktrace from VSCode tsserver log:

```
Err 139   [22:05:40.607] Exception on executing command delayed processing of request 25:

    Debug Failure. False expression: Containing file should be a module.

    Error: Debug Failure. False expression: Containing file should be a module.
        at checkImportMetaProperty (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:70401:22)
        at checkMetaProperty (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:70376:24)
        at checkExpressionWorker (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72737:28)
        at checkExpression (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72628:38)
        at checkNonNullExpression (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:67648:37)
        at checkPropertyAccessExpression (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:67693:85)
        at checkExpressionWorker (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72708:28)
        at checkExpression (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72628:38)
        at checkExpressionWithContextualType (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72275:28)
        at getSignatureApplicabilityError (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:68797:35)
        at chooseOverload (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:69306:25)
        at resolveCall (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:69180:26)
        at resolveNewExpression (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:69649:24)
        at resolveSignature (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:69961:28)
        at getResolvedSignature (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:69990:26)
        at checkCallExpression (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:70116:29)
        at checkExpressionWorker (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72719:28)
        at checkExpression (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72628:38)
        at checkExpressionCached (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72304:38)
        at checkDeclarationInitializer (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:72317:148)
        at getTypeForVariableLikeDeclaration (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:50953:74)
        at getWidenedTypeForVariableLikeDeclaration (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:51355:56)
        at getTypeOfVariableOrParameterOrPropertyWorker (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:51497:24)
        at getTypeOfVariableOrParameterOrProperty (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:51392:28)
        at getTypeOfSymbol (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:51735:24)
        at checkVariableLikeDeclaration (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:75078:41)
        at checkVariableDeclaration (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:75158:13)
        at checkSourceElementWorker (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:77850:28)
        at checkSourceElement (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:77695:17)
        at Object.forEach (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:190:30)
        at checkVariableStatement (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:75169:16)
        at checkSourceElementWorker (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:77819:28)
        at checkSourceElement (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:77695:17)
        at Object.forEach (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:190:30)
        at checkSourceFileWorker (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:78040:20)
        at checkSourceFile (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:78007:13)
        at getDiagnosticsWorker (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:78096:17)
        at Object.getDiagnostics (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:78082:24)
        at /snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:107275:85
        at runWithCancellationToken (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:107237:24)
        at getBindAndCheckDiagnosticsForFileNoCache (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:107263:20)
        at getAndCacheDiagnostics (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:107539:26)
        at getBindAndCheckDiagnosticsForFile (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:107260:20)
        at getSemanticDiagnosticsForFile (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:107257:60)
        at getDiagnosticsHelper (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:107179:24)
        at Object.getSemanticDiagnostics (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:107192:20)
        at Proxy.getSemanticDiagnostics (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:149195:47)
        at IOSession.Session.semanticCheck (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:159618:52)
        at /snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:159674:31
        at MultistepOperation.executeAction (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:158624:25)
        at /snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:158603:100
        at IOSession.Session.executeWithRequestId (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:160908:28)
        at Object.executeWithRequestId (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:159386:87)
        at Immediate._onImmediate (/snap/code-insiders/638/usr/share/code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:158603:41)
        at processImmediate (internal/timers.js:456:21)

```

VSCode suggestions stop working:

![no-intellisense](https://user-images.githubusercontent.com/23744935/108422855-65b41300-7237-11eb-9c2f-2b1ed2258116.png)