Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not install if absolute path mappings are specified in import_map.json #98

Closed
sramam opened this issue Jun 22, 2021 · 7 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@sramam
Copy link

sramam commented Jun 22, 2021

Starting with a import_map.json that has mappings for absolute paths

{
  "imports": {
    "/": "./",
    "./": "./",
  }
}
trex --custom react=https://esm.sh/react@17.0.1

results in an error:

error: Uncaught (in promise) PermissionDenied: Access is denied. (os error 5)
    const buffer = await Deno.readFile(path);
                ^
    at deno:core/core.js:86:46
    at unwrapOpResult (deno:core/core.js:106:13)
    at async open (deno:runtime/js/40_files.js:46:17)
    at async Object.readFile (deno:runtime/js/40_read_file.js:20:18)
    at async readURLContent (https://deno.land/x/trex@v1.7.0/handlers/handle_files.ts:96:17)
    at async generateHash (https://deno.land/x/trex@v1.7.0/handlers/handle_files.ts:107:14)
    at async createPackage (https://deno.land/x/trex@v1.7.0/handlers/handle_files.ts:59:52)

Removing the absolute maps solves the problem.

@buttercubz
Copy link
Member

i can confirm this bug

@buttercubz buttercubz self-assigned this Jun 22, 2021
@buttercubz buttercubz added the bug Something isn't working label Jun 22, 2021
@buttercubz
Copy link
Member

this problem is fixed in dev branch

@sramam
Copy link
Author

sramam commented Jun 22, 2021

verified! thanks for the quick turn around.

@sramam sramam closed this as completed Jun 22, 2021
@sant123
Copy link

sant123 commented Jul 2, 2021

Tested with v1.8.0 but getting this error with the following dependencies:

image

Sorry is it something I'm doing wrong? Please let me know.

Thanks!

@buttercubz
Copy link
Member

Tested with v1.8.0 but getting this error with the following dependencies:

image

Sorry is it something I'm doing wrong? Please let me know.

Thanks!

hi, it seems that you are trying to verify the integrity of a path that is not a package "/", a quick solution would be to delete the trex_storage folder that is in the .deno folder and doing a trex install again

@sant123
Copy link

sant123 commented Jul 2, 2021

It works!!! Thank you so much!

@sant123
Copy link

sant123 commented Jul 2, 2021

I'll leave this script for someone who needs to test this feature meanwhile this PR gets merged:

deno install -Af --unstable --import-map=https://raw.githubusercontent.com/crewdevio/Trex/dev/import_map.json -n trex --no-check https://raw.githubusercontent.com/crewdevio/Trex/dev/cli.ts

buttercubz added a commit that referenced this issue Jul 2, 2021
* feat: better main file detection

* fix: import typo

* fix: test on macos

* feat: virtual cli tool execution

* fix: add default error message in exec command

* chore: update std to std@0.99.0

* chore: upgrade ci version

* fix: test

* Update run.ts (#95)

* Update run.ts

Co-authored-by: Rivier Grullon <45011060+RivierGrullon@users.noreply.github.com>
Co-authored-by: Erick Sosa <ericksosagarcias@gmail.com>
Co-authored-by: Mark Gibson <mgibson@adaptavist.com>

* fix: URL parameter values being stripped #97

* fix: does not install if absolute path mappings are specified #98

* chore: update cli version

Co-authored-by: michael spengler <43786652+michael-spengler@users.noreply.github.com>
Co-authored-by: Rivier Grullon <45011060+RivierGrullon@users.noreply.github.com>
Co-authored-by: Mark Gibson <mgibson@adaptavist.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants