W
Windmill•13mo ago
ym1198

Hovering on "npm:axios" & caching do nothing

Using deno script Have an import as import axios from "npm:axios"; it should error (red lines below text) I hover over it & click on quick fix > cache dependency. It did nothing. The workspace was not created by me. But I have admin access in it , i think (will confirm once) Surprisingly, in another workspace which I created, it actually cached the axios npm lib & error went away.
10 Replies
rubenf
rubenf•13mo ago
who created the workspace should have no effect on this lsp can be a bit flaky at times
ym1198
ym1198•13mo ago
we are not using caddy, we converted to nginx and i set the config for lsp as
location /ws/ {
proxy_pass http://lsp_us;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /ws/ {
proxy_pass http://lsp_us;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
But if it worked in one scenario it means it is correct will try with another workspace created by me & revert. just to get reproducible issue (maybe it could be this issue)
rubenf
rubenf•13mo ago
No I can guarantee you it has nothing to do with the workspace I wrote the implementation
ym1198
ym1198•13mo ago
oh 😅 cool cool any idea or workaround for this then ? i am forced to use deno axios-like instead of npm axios
rubenf
rubenf•13mo ago
reload the page, it might just work
ym1198
ym1198•13mo ago
tried just now, did not worked Getting this in websocket response
{
"jsonrpc": "2.0",
"result": {
"title": "Cache \"npm:axios\" and its dependencies.",
"kind": "quickfix",
"diagnostics": [
{
"range": {
"start": {
"line": 1,
"character": 18
},
"end": {
"line": 1,
"character": 29
}
},
"severity": 1,
"code": "no-cache-npm",
"source": "deno",
"message": "Uncached or missing npm package: \"axios\".",
"data": {
"specifier": "npm:axios"
}
}
],
"command": {
"title": "",
"command": "deno.cache",
"arguments": [
[
"npm:axios"
]
]
}
},
"id": 11
}
{
"jsonrpc": "2.0",
"result": {
"title": "Cache \"npm:axios\" and its dependencies.",
"kind": "quickfix",
"diagnostics": [
{
"range": {
"start": {
"line": 1,
"character": 18
},
"end": {
"line": 1,
"character": 29
}
},
"severity": 1,
"code": "no-cache-npm",
"source": "deno",
"message": "Uncached or missing npm package: \"axios\".",
"data": {
"specifier": "npm:axios"
}
}
],
"command": {
"title": "",
"command": "deno.cache",
"arguments": [
[
"npm:axios"
]
]
}
},
"id": 11
}
update: I am now using import axios from 'https://esm.sh/axios'; and this seems to solve the issue with npm:axios
rubenf
rubenf•13mo ago
question, are you sure axios expose types ?
rubenf
rubenf•13mo ago
Deno
npm: specifiers | Manual | Deno
Since version 1.28, Deno has native support for importing npm packages. This is done by importing using npm: specifiers.
ym1198
ym1198•13mo ago
npm
axios
Promise based HTTP client for the browser and node.js. Latest version: 1.4.0, last published: a month ago. Start using axios in your project by running npm i axios. There are 102678 other projects in the npm registry using axios.
ym1198
ym1198•13mo ago
because I have been using axios in my nodeTS project