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

[complie] Importing node modules does not work with byonm flag when entrypoint in a sub dir #24654

Closed
yasaichi opened this issue Jul 20, 2024 · 0 comments · Fixed by #24755
Closed
Labels
bug Something isn't working correctly compile related to the `deno compile` feature

Comments

@yasaichi
Copy link

yasaichi commented Jul 20, 2024

Version: Deno 1.45.0 to 1.45.2

From v1.45.0, compiling files not in a root directory results in a runtime error: Relative import path "module_name" not prefixed with / or ./ or ../. Here is the minimum setup and commands to reproduce this bug.
I assume the point is that compiling files in a root directory works fine even in the latest version.

Setup

// <project-root>/src/main.ts
import { Option } from 'effect';
Option.isNone;
// <project-root>/deno.jsonc
{
  "unstable": ["byonm"]
}

Commands

$ pwd
<project-root>
$ pnpm install
$ deno compile --output main ./src/main.ts
$ ./main
error: Relative import path "effect" not prefixed with / or ./ or ../

For further details, please see this repo: https://github.com/yasaichi/reproduce-deno-compile-bug-24654

@dsherret dsherret added bug Something isn't working correctly compile related to the `deno compile` feature labels Jul 20, 2024
@dsherret dsherret changed the title [complie] Importing node modules does not work with byonm flag on [complie] Importing node modules does not work with byonm flag when entrypoint in a sub dir Jul 26, 2024
dsherret added a commit that referenced this issue Jul 26, 2024
Regression in 1.45.0 caused by storing relative paths instead of
absolute paths in the binary.

Closes #24654
crowlKats pushed a commit that referenced this issue Jul 31, 2024
Regression in 1.45.0 caused by storing relative paths instead of
absolute paths in the binary.

Closes #24654

(cherry picked from commit 06b6352)
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 compile related to the `deno compile` feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants