-
Notifications
You must be signed in to change notification settings - Fork 648
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
Relative import path "preact" not prefixed with / or ./ or ../deno(import-prefix-missing) #514
Comments
Are the files at the root of your VS Code directory? |
@lucacasonato Yes, they are, just a standard fresh install following the docs steps. |
Yeah, definitely some issue is happening, I tried the Fresh tutorial from the docs on three different laptops, and they all have the same problem. Two of them are intel, and the other is an M1. |
What is the contents of the What is the debug output of vscode under Deno Language Server? |
Everything is as on the docs: https://fresh.deno.dev/docs/getting-started/create-a-project
{
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
},
"importMap": "./import_map.json"
}
{
"deno.enable": true,
"deno.unstable": true
}
{
"imports": {
"$fresh/": "https://deno.land/x/[email protected]/",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"preact-render-to-string": "https://esm.sh/[email protected][email protected]"
}
}
|
Ok, for some reason the Deno Language Server is not identifying the configuration and import map. In the logged output I would expected to see something like:
For troubleshooting purposes, could you try to things and see if the output changes:
|
That worked! Thanks a lot. I noticed something. It only worked on the settings UI of VsCode. When I added that to the Thanks for all the help. Maybe this can be added to some docs. I hit across some other people who are experiencing the same issue. |
@Esteban-Rocha what does you project structure look like? (for example is your Are you saying adding a value to |
Correct.
Tried:
None worked;
Workspace settings. |
Can you provide the contents of And one more favour, under the command palette run Deno: Language Server Status and provide the Workspace Settings section? Something is clearly not working as expected, because based on everything you are demonstrating it should have just worked but clearly it hasn't. |
@Esteban-Rocha thanks for that... something strange is going on. In the Is this a multi-root workspace that you are working with? |
@kitsonk Hey! Yes, it seems it is. |
Ah, ok... hmmm... well, that would explain it all. 😄
|
Just wondering, why two imports ?
and not just one import !! |
That is the way import maps work. The first one is a specific specifier, meaning |
Thank goodness I found this issue. I have been quite confused about these errors and almost gave up on trying Deno/Fresh. At least I know the origin of the problem now, but it's actually still not working for me. I've set the path to the config in the workspace level as above. |
The only way I could get it working properly was to abandon using a multi-root workspace, unfortunately. Though, this didn't stop the language server from crashing.
I thought this was supposed to be disabled when the Deno language server is enabled. |
Closing because multi-root workspace support is an upstream Deno issue, and not specific to Fresh. |
Boils down to:
|
Hello! I literally just started a new project to learn Fresh and I got these issues, I wonder if anyone has any idea of what might be happening?
$ deno -V: deno 1.23.4
Installed via:
curl -fsSL https://deno.land/install.sh | sh
macOS: Monterrey
settings.json
import_map.json
Using VsCode and https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
The text was updated successfully, but these errors were encountered: