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

bug: script within workspace throws on last inter-workspace import #24340

Closed
iuioiua opened this issue Jun 26, 2024 · 0 comments · Fixed by #24334
Closed

bug: script within workspace throws on last inter-workspace import #24340

iuioiua opened this issue Jun 26, 2024 · 0 comments · Fixed by #24334
Assignees
Labels
bug Something isn't working correctly std Affects the Deno Standard Library workspaces

Comments

@iuioiua
Copy link
Collaborator

iuioiua commented Jun 26, 2024

Running deno run -A http/file_server.ts in the Standard Library causes the following error:

asher@Ashers-MacBook-Air deno_std % deno run -A http/file_server.ts
error: Relative import path "@std/net/get-network-address" not prefixed with / or ./ or ../
    at file:///Users/asher/GitHub/deno_std/http/file_server.ts:54:35

Notice this throws on the last import (see here), which is an inter-package import.

Now, when we remove that import and rerun the script, we get the following error:

asher@Ashers-MacBook-Air deno_std % deno run -A http/file_server.ts
error: Relative import path "@std/fmt/bytes" not prefixed with / or ./ or ../
    at file:///Users/asher/GitHub/deno_std/http/file_server.ts:53:39

Notice this still throws on what is now the last import (see here).

Reverting the previous line deletion, if the root Deno configuration file is defined, the script runs successfully. In other words, using deno run --config=deno.json -A http/file_server.ts works fine.

deno 1.44.4+09cc473 (canary, aarch64-apple-darwin)
v8 12.6.228.9
typescript 5.4.5
@iuioiua iuioiua added bug Something isn't working correctly std Affects the Deno Standard Library labels Jun 26, 2024
zebreus pushed a commit to zebreus/deno that referenced this issue Jul 8, 2024
Adds much better support for the unstable Deno workspaces as well as
support for npm workspaces. npm workspaces is still lacking in that we
only install packages into the root node_modules folder. We'll make it
smarter over time in order for it to figure out when to add node_modules
folders within packages.

This includes a breaking change in config file resolution where we stop
searching for config files on the first found package.json unless it's
in a workspace. For the previous behaviour, the root deno.json needs to
be updated to be a workspace by adding `"workspace":
["./path-to-pkg-json-folder-goes-here"]`. See details in
denoland/deno_config#66

Closes denoland#24340
Closes denoland#24159
Closes denoland#24161
Closes denoland#22020
Closes denoland#18546
Closes denoland#16106
Closes denoland#24160
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly std Affects the Deno Standard Library workspaces
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants