-
Notifications
You must be signed in to change notification settings - Fork 168
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
Import a script inside a component or api cause an error #107
Comments
I would call this normal behavior because you should only be importing stuff from CDNs and from within the project folder. It does make the situation a little ugly for monorepos though, monorepos with deno is something that is still being figured out though anyways. |
You only use "../" or "./" relative paths when the file exists locally in your machine. If it doesn't then you should be using an URL to import from wherever you have it |
hum my other projects inside the monorepo work well (install, bundle...). With a symlink of the external project inside root of aleph project, it is ok. |
This might be due to the fact that alephjs movies files around before executing them. I know this isn't an import but this is how I access files. import * as path from "https://deno.land/[email protected]/path/mod.ts";
const dir = path.fromFileUrl(import.meta.url);
const projectDir = path.resolve(dir, "../../../../"); // The files are located in the same directory (api), but in order to work, you need to move up 4 directories for the project root directory.
const schemaFilePath = path.resolve(projectDir, "api/schema.gql");
Deno.readTextFileSync(schemaFilePath); |
@RoXuS Can you please show your project structure? I feel like I am giving advise without actually knowing what I'm dealing with |
@Soremwar off course. My @FallingSnow it seems hard to do that with a file import like |
Yeah. I don't know if deno supports |
i seems the |
please use synlimk as workaround currently |
works as expected on 1.8.0, THX! |
Hey!
I'm trying to call a script outside my aleph project (I am on a monorepo project).
When I do that I get the following error:
It's normal behavior? We can't call a script outside the component?
The text was updated successfully, but these errors were encountered: