denoland / denoland/deploy_feedback

bug: unable to import from `/src` project subdir when using import map

Open
#278 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
79
Forks
5
PR merge metrics
No merged PRs in 30d

Description

hi,
i created a test repository with this file structure (each `mod.js` is empty file, `import_map` is filled to make absolute imports work, the `main.js` file just imports mods absolutely):
> /deno.json
> /import_map.json
> /main.js
> /lib/mod_1.js
> /src/mod_2.js
> /src/src/mod_3.js
```json
"imports": {
"/": "./",
"./": "./"
}
```
```js
// main.js
import mod_3 from '/src/src/mod_3.js';
import mod_2 from '/src/mod_2.js';
import mod_1 from '/lib/mod_1.js';
```

and when trying to deploy via Git Integration (or deployctl), an error occurs:
> Cloning repository (100%)
> Downloaded file:///src/main.js
> Downloaded file:///src/mod_2.js
> Downloaded file:///src/src/mod_3.js
> Downloaded file:///src/lib/mod_1.js
> Error The deployment failed: Module not found "file:///src/mod_2.js".

the file structure in the deploy is the same as in the repo, but only 1 and 3 mods are imported fine
on localhost all mods are imported without errors

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the deployment with deno.json, import_map.json, main.js, and the listed lib/ and src/ files using deployctl or Git Integration, then compare it with the successful localhost import. The issue is resolved when /src/mod_2.js and the other absolute imports deploy and load consistently with the repository structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.