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

Fix deps when used as a library #2

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Conversation

alexgleason
Copy link
Contributor

When trying to use this library from deno.land, my application crashes on start with this error:

Watcher File change detected! Restarting!
error: Relative import path "zod" not prefixed with / or ./ or ../ and not in import map from "https://deno.land/x/dongoose@1.0.1/src/schema.ts"
    at https://deno.land/x/dongoose@1.0.1/src/schema.ts:2:19
Watcher Process finished. Restarting on file change...

This MR fixes it by creating a deps.ts and deps_test.ts. Deno can't use import maps for libraries since it doesn't know the URL of the import map. So when the project is a library it has to be this way.

Copy link
Owner

@roonie007 roonie007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roonie007 roonie007 merged commit 8a372d0 into roonie007:main Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants