denoland / denoland/deploy_feedback
Error only when using dynamic import and static import at the same time
- Dominant language
- No language data
- Stars
- 79
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Running the code below with deno deploy currently gives a module not found error.
```ts
import { serve } from "https://deno.land/std@0.177.0/http/server.ts";
serve((req: Request) => new Response("Hello World"));
if(false){
await import("https://deno.land/std@0.177.0/http/server.ts")
}
```
```
module not found: https://deno.land/std@0.177.0/http/server.ts
```
If I change the import specifier to something else, this error does not occur.
```ts
import { serve } from "https://deno.land/std@0.177.0/http/server.ts";
serve((req: Request) => new Response("Hello World"));
if(false){
await import("https://deno.land/std@0.177.0/http/mod.ts") // If I change the path here it works
}
```
It seems that the error occurs only when the static import specifier and the dynamic import specifier **exactly match**.
Finding the cause of this error can seem very difficult when dependencies are complex. (The error message doesn't explain anything.)
Since the `if(false)...` part is not executed at all in the code above, it would be nice if it executed without an error here.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the provided TypeScript snippet on Deno Deploy, then compare it with the version whose dynamic import uses a different path. Done means a matching dynamic import inside the unreachable if(false) block no longer causes a module-not-found error, and the reported behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100