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

When changing the source directory, import maps needs to be in the source for the runtime to work #2292

Open
ooker777 opened this issue Jan 31, 2024 · 2 comments

Comments

@ooker777
Copy link

ooker777 commented Jan 31, 2024

When changing the source directory, if the import map is still in the root, then this error will happen:

error: Uncaught (in promise) TypeError: Relative import path "typography" not prefixed with / or ./ or ../ and not in import map from "file:///D:/QC%20supplements/Code/Apps/Tr%E1%BA%A5n%20K%E1%BB%B3/Web/tailwind.config.ts"

The runtime still needs the import map in the source directory. However, for the LSP to work, a duplication of it needs to be on the root.

Related bug: denoland/deploy_feedback#590

@deer
Copy link
Contributor

deer commented Jan 31, 2024

I can only imagine this would be an issue if you're launching the program from within the source directory. If you're launching it like this: deno run -A src/dev.ts then it should be fine. Are you saying that this isn't working?

@ooker777
Copy link
Author

yes. I'm on root, and the deno.jsonc in root is like this:

"tasks": {
	"check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
	"cli": "echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
	"manifest": "deno task cli manifest $(pwd)",
	"start": "deno run -A --watch=static/,routes/ './Web/dev.ts'",
	"build": "deno run -A './Web/dev.ts' build",
	"preview": "deno run -A ./Web/main.ts",
	"update": "deno run -A -r https://fresh.deno.dev/update ."
},

I only use tasks, not run the full commands directly

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

No branches or pull requests

2 participants