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

v0.38.0 is throwing a lot of errors #1477

Closed
djfhe opened this issue Jun 18, 2022 · 6 comments
Closed

v0.38.0 is throwing a lot of errors #1477

djfhe opened this issue Jun 18, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@djfhe
Copy link

djfhe commented Jun 18, 2022

Just updated to v0.38.0 and volar is throwing a lot of errors:
image

v0.37.9 works fine.

Vite + Vue 3 + Typescript project, with takeover mode enabled.

Showcase Repo

Piece of the error log:
[Error - 1:14:49 AM] Request textDocument/inlayHint failed.
  Message: Request textDocument/inlayHint failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
[Error - 1:14:49 AM] Request textDocument/codeLens failed.
  Message: Request textDocument/codeLens failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
[Error - 1:14:49 AM] Request textDocument/inlayHint failed.
  Message: Request textDocument/inlayHint failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
[Error - 1:14:49 AM] Request textDocument/codeAction failed.
  Message: Request textDocument/codeAction failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
[Error - 1:14:49 AM] Request textDocument/codeAction failed.
  Message: Request textDocument/codeAction failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
[Error - 1:14:49 AM] Request textDocument/semanticTokens/range failed.
  Message: Request textDocument/semanticTokens/range failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
[Error - 1:14:49 AM] Request textDocument/codeAction failed.
  Message: Request textDocument/codeAction failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
[Error - 1:14:49 AM] Request textDocument/semanticTokens/range failed.
  Message: Request textDocument/semanticTokens/range failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
/home/djfhe/.vscode/extensions/vue.volar-0.38.0-linux-x64/dist/node/server.js:1257
`),S;function B(){let O=d.content;for(let j of A.sort((M,U)=>U.start-M.start)){let M=j.end;O.substring(M,M+1)===";"&&M++,O=O.substring(0,j.start)+O.substring(M)}return O.trim()}function Y(O){let j=d.content.substring(O.start,O.end);switch(j){case"Function":return"Function";case"string":return"String";case"boolean":return"Boolean";case"number":return"Number";case"object":return"Object"}return j.endsWith("]")?`Array as PropType<${j}>`:j.endsWith("}")?`Object as PropType<${j}>`:`null as any as PropType<${j}>`}function Z(O,j,M){d.content.substring(O,j)!==M&&S.push(gb.TextEdit.replace({start:E.positionAt(T+O),end:E.positionAt(T+j)},M))}})}})}function ume(t,e,r){var n;return Yf(this,void 0,void 0,function*(){let i=t.getDocument(),s=(n=yield e(i.uri,{start:i.positionAt(0),end:i.positionAt(i.getText().length)},{diagnostics:[],only:[`${gb.CodeActionKind.Source}.addMissingImports.ts`]}))!==null&&n!==void 0?n:[];for(let a of s){let o=yield r(a);if(o.edit)return o.edit}})}Xf.getAddMissingImportsEdits=ume});var fme=D(Jx=>{"use strict";var Gx=Jx&&Jx.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(p){a(p)}}function l(u){try{c(n.throw(u))}catch(p){a(p)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Jx,"__esModule",{value:!0});var pme=it(),dme=Z6(),Kx=ft(),H1t=wf(),K1t=Ns(),hme=DA(),G1t=Sq(),bb;(function(t){t.USE_REF_SUGAR="refSugarConversions.use",t.UNUSE_REF_SUGAR="refSugarConversions.unuse"})(bb||(bb={}));function J1t(t){return{codeLens:{on(r){return e(r.uri,n=>Gx(this,void 0,void 0,function*(){var i,s,a;if(r.uri.endsWith(".html")||!((s=yield(i=(0,K1t.useConfigurationHost)())===null||i===void 0?void 0:i.getConfiguration("volar.codeLens.scriptSetupTools"))!==null&&s!==void 0?s:!0))return;let l=[],c=n.file.getDescriptor(),u=n.file.getSfcRefSugarRanges(),p=n.file.getCompiledVue();if(c.scriptSetup&&u){let d=(a=p.getSourceRange(c.scriptSetup.startTagEnd))===null||a===void 0?void 0:a[0].start;d&&l.push({range:{start:r.positionAt(d),end:r.positionAt(d+c.scriptSetup.content.length)},command:{title:"ref sugar "+(u.refs.length?"\u2611":"\u2610"),command:u.refs.length?bb.UNUSE_REF_SUGAR:bb.USE_REF_SUGAR,arguments:[r.uri]}})}return l}))}},doExecuteCommand(r,n,i){if(r===bb.USE_REF_SUGAR){let[s]=n;return e(s,a=>Y1t(t.ts,a,i,t.findReferences,t.findTypeDefinition,t.scriptTsLs))}if(r===bb.UNUSE_REF_SUGAR){let[s]=n;return e(s,a=>X1t(a,i,t.doCodeActions,t.doCodeActionResolve,t.doRename,t.doValidation))}}};function e(r,n){let i=t.getVueDocument(r);if(!!i)return n(i)}}Jx.default=J1t;function Y1t(t,e,r,n,i,s){return Gx(this,void 0,void 0,function*(){let a=e.file.getDescriptor();if(!a.scriptSetup)return;let o=e.file.getScriptSetupAst();if(!o)return;r.workDoneProgress.begin("Unuse Ref Sugar",0,"",!0);let l=yield c(e,a.scriptSetup,o);if(r.token.isCancellationRequested)return;l?.length&&(yield r.applyEdit({changes:{[e.uri]:l}})),r.workDoneProgress.done();function c(u,p,d){var h,f,m;return Gx(this,void 0,void 0,function*(){let w=(h=u.file.getCompiledVue().getSourceRange(p.startTagEnd))===null||h===void 0?void 0:h[0].start;if(w===void 0)return;let x=(0,dme.parseDeclarationRanges)(t,d),b=(0,dme.parseDotValueRanges)(t,d),g=u.getDocument(),_=[];for(let T of x){let E=!1;for(let S of T.leftBindings){let A=(f=yield i(g.uri,g.positionAt(w+S.end)))!==null&&f!==void 0?f:[];if(!(0,hme.isRefType)(A,s))continue;E=!0;let I=(m=yield n(g.uri,g.positionAt(w+S.end)))!==null&&m!==void 0?m:[];I=I.filter(N=>{if(N.uri!==g.uri)return!1;let B=g.offsetAt(N.range.start),Y=g.offsetAt(N.range.end);return!(B>=w+S.start&&Y<=w+S.end||Y<w||B>w+p.content.length||(0,hme.isBlacklistNode)(t,d,B-w))});for(let N of I){let B=g.offsetAt(N.range.start),Y=g.offsetAt(N.range.end),Z=B-w,O=Y-w,j=b.find(M=>M.beforeDot===O);j?C(j.beforeDot,j.range.end,""):(C(Z,Z,"$raw("),C(O,O,")"))}}if(E)if(!T.leftIsIdentifier)C(T.right.start,T.right.start,"$fromRefs("),C(T.right.end,T.right.end,")");else if(T.rightFn){let S=p.content.substring(T.rightFn.start,T.rightFn.end);["ref","shallowRef"].includes(S)&&C(T.flag.start,T.flag.end,"let"),["ref","computed","shallowRef"].includes(S)&&C(T.right.start,T.right.start,"$")}else C(T.right.start,T.right.start,"$ref("),C(T.right.end,T.right.end,")")}return _;function C(T,E,S){p.content.substring(T,E)!==S&&_.push(Kx.TextEdit.replace({start:g.positionAt(w+T),end:g.positionAt(w+E)},S))}})}})}function X1t(t,e,r,n,i,s){var a;return Gx(this,void 0,void 0,function*(){let o=t.file.getDescriptor();if(!o.scriptSetup)return;let l=t.file.getScriptSetupAst();if(!l)return;e.workDoneProgress.begin("Unuse Ref Sugar",0,"",!0);let c=yield p(t,o.scriptSetup,l);if(e.token.isCancellationRequested)return;if(c?.length){yield e.applyEdit({changes:{[t.uri]:c}}),yield pme.sleep(200);let d=(a=yield s(t.uri))!==null&&a!==void 0?a:[],h=yield(0,G1t.getAddMissingImportsEdits)(t,r,n),f=u(t,d);h&&f?((0,H1t.mergeWorkspaceEdits)(h,f),yield e.applyEdit(h)):(h||f)&&(yield e.applyEdit(h??f))}e.workDoneProgress.done();function u(d,h){let f=d.getDocument(),m=[];for(let w of h){let x=f.getText(w.range);w.code===2339&&x==="value"&&m.push(Kx.TextEdit.del({start:{line:w.range.start.line,character:w.range.start.character-1},end:w.range.end}))}return m.length?{documentChanges:[Kx.TextDocumentEdit.create(Kx.OptionalVersionedTextDocumentIdentifier.create(f.uri,f.version),m)]}:void 0}function p(d,h,f){var m;return Gx(this,void 0,void 0,function*(){let w=(m=d.file.getCompiledVue().getSourceRange(h.startTagEnd))===null||m===void 0?void 0:m[0].start;if(w===void 0)return;let x=d.file.getSfcRefSugarRanges(),b=d.getDocument(),g=[];if(!x)return;let _=0,C=0;for(let S of x.refs)_+=S.leftBindings.length;for(let S of x.refs){E(S.flag.start,S.flag.end,"const");let A=h.content.substring(S.rightFn.start,S.rightFn.end);if(A!=="$fromRefs"){let P=A.substring(1);E(S.rightFn.start,S.rightFn.end,P)}for(let P of S.leftBindings){if(e.token.isCancellationRequested)return;let I=h.content.substring(P.start,P.end);e.workDoneProgress.report(++C/_*100,I),yield pme.sleep(0);let N=h.content.substring(P.start,P.end),B=yield i(d.uri,b.positionAt(w+P.end),N+".value");if(B?.changes){let Y=B.changes[d.uri];if(Y)for(let Z of Y){let O={start:b.offsetAt(Z.range.start),end:b.offsetAt(Z.range.end)};O.start>=w+P.start&&O.end<=w+P.end||O.end<w||O.start>w+h.content.length||T(O.start,O.end)||g.push(Z)}}}}for(let S of x.raws)E(S.fullRange.start,S.argsRange.start,""),E(S.argsRange.end,S.fullRange.end,"");return g;function T(S,A){if(x){for(let P of x.raws)if(S>=w+P.argsRange.start&&A<=w+P.argsRange.end)return!0}return!1}function E(S,A,P){h.content.substring(S,A)!==P&&g.push(Kx.TextEdit.replace({start:b.positionAt(w+S),end:b.positionAt(w+A)},P))}})}})}});var _q=D(kd=>{"use strict";var mme=kd&&kd.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(p){a(p)}}function l(u){try{c(n.throw(u))}catch(p){a(p)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(kd,"__esModule",{value:!0});kd.convertTagNameCasingCommand=void 0;var gme=ft(),Tq=no();kd.convertTagNameCasingCommand="tagNameCasingConversions";function Q1t(t){return{doExecuteCommand(r,n,i){return mme(this,void 0,void 0,function*(){if(r===kd.convertTagNameCasingCommand){let[s,a]=n;return e(s,o=>mme(this,void 0,void 0,function*(){var l;let c=o.file.getDescriptor();if(!c.template)return;i.workDoneProgress.begin("Convert Tag Name",0,"",!0);let u=c.template,p=o.getDocument(),d=[],h=new Set((yield o.getTemplateData()).components),f=o.getTemplateTagsAndAttrs().tags,m=0;for(let[v,w]of f)if(w.length){if(i.token.isCancellationRequested)return;i.workDoneProgress.report(m++/Object.keys(f).length*100,v);let x=u.startTagEnd+w[0],b=(l=yield t.findReferences(s,o.getDocument().positionAt(x)))!==null&&l!==void 0?l:[];for(let g of b)if(g.uri===o.uri&&p.offsetAt(g.range.start)>=u.startTagEnd&&p.offsetAt(g.range.end)<=u.startTagEnd+u.content.length){let _=p.getText(g.range);for(let C of h)(C===_||(0,Tq.hyphenate)(C)===_)&&(a==="kebab"&&_!==(0,Tq.hyphenate)(C)&&d.push(gme.TextEdit.replace(g.range,(0,Tq.hyphenate)(C))),a==="pascal"&&_!==C&&d.push(gme.TextEdit.replace(g.range,C)))}}i.applyEdit({changes:{[p.uri]:d}}),i.workDoneProgress.done()}))}})}};function e(r,n){let i=t.getVueDocument(r);if(!!i)return n(i)}}kd.default=Q1t});var bme=D(Qf=>{"use strict";var rp=Qf&&Qf.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(p){a(p)}}function l(u){try{c(n.throw(u))}catch(p){a(p)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Qf,"__esModule",{value:!0});Qf.semanticTokenTypes=void 0;var f5=it(),Z1t=Zm(),ebt=c_(),tbt=Ns(),Eq=Wp(),Mo=no(),np=ho(),Xx=(Hw(),Rr($w)),Si=ft();Qf.semanticTokenTypes=["componentTag"];var yme={stop:"call event.stopPropagation().",prevent:"call event.preventDefault().",capture:"add event listener in capture mode.",self:"only trigger handler if event was dispatched from this element.",once:"trigger handler at most once.",left:"only trigger handler for left button mouse events.",right:"only trigger handler for right button mouse events.",middle:"only trigger handler for middle button mouse events.",passive:"attaches a DOM event with { passive: true }."},rbt=Xx.newHTMLDataProvider("vueGlobalDirective",{version:1.1,tags:[],globalAttributes:[{name:"v-if"},{name:"v-else-if"},{name:"v-else",valueSet:"v"},{name:"v-for"}]});function nbt(t){var e,r;let n=new WeakMap,i=new WeakSet,s=new Map(t.getSemanticTokenLegend().tokenTypes.map((f,m)=>[f,m])),a=t.vueLsHost.getVueCompilationSettings().experimentalRuntimeMode;return Object.assign(Object.assign({},t.templateLanguagePlugin),{complete:{triggerCharacters:[...(r=(e=t.templateLanguagePlugin.complete)===null||e===void 0?void 0:e.triggerCharacters)!==null&&r!==void 0?r:[],"@"],on(f,m,v){var w,x;return rp(this,void 0,void 0,function*(){if(!t.isSupportedDocument(f))return;let b=t.vueDocuments.fromEmbeddedDocument(f),g;b&&(g=yield c(b));let _=yield(x=(w=t.templateLanguagePlugin.complete)===null||w===void 0?void 0:w.on)===null||x===void 0?void 0:x.call(w,f,m,v);if(!!_)return b&&g&&p(_,b,g),_})},resolve(f){return rp(this,void 0,void 0,function*(){let m=f.data;return m?.mode==="html"?yield o(f,m):m?.mode==="autoImport"?yield l(f,m):f})}},doHover(f,m){var v,w;let x=t.vueDocuments.fromEmbeddedDocument(f);return x&&t.templateLanguagePlugin.htmlLs.setDataProviders(u(x.uri),t.templateLanguagePlugin.getHtmlDataProviders()),(w=(v=t.templateLanguagePlugin).doHover)===null||w===void 0?void 0:w.call(v,f,m)},doValidation(f,m){var v,w;return rp(this,void 0,void 0,function*(){if(!t.isSupportedDocument(f))return;let x=yield(w=(v=t.templateLanguagePlugin).doValidation)===null||w===void 0?void 0:w.call(v,f,m),b=t.vueDocuments.fromEmbeddedDocument(f);if(b){let g=[],_=b.file.getSfcVueTemplateCompiled(),C=b.file.getSfcTemplateLanguageCompiled();if(_&&C){let T=function(E,S){var A,P,I,N;let B={start:(P=(A=E.loc)===null||A===void 0?void 0:A.start.offset)!==null&&P!==void 0?P:0,end:(N=(I=E.loc)===null||I===void 0?void 0:I.end.offset)!==null&&N!==void 0?N:0},Y=C.mapping(B),Z=E.message;if(!Y){let O=C.html.substring(B.start,B.end);Z+="\n```html\n"+O.trim()+"\n```",Y={start:0,end:0}}g.push({range:{start:f.positionAt(Y.start),end:f.positionAt(Y.end)},severity:S,code:E.code,source:"vue",message:Z})};for(let E of _.errors)T(E,Si.DiagnosticSeverity.Error);for(let E of _.warnings)T(E,Si.DiagnosticSeverity.Warning)}return[...x??[],...g]}})},findDocumentSemanticTokens(f,m){var v,w,x,b;return rp(this,void 0,void 0,function*(){if(!t.isSupportedDocument(f))return;let g=(x=yield(w=(v=t.templateLanguagePlugin).findDocumentSemanticTokens)===null||w===void 0?void 0:w.call(v,f,m))!==null&&x!==void 0?x:[],_=t.vueDocuments.fromEmbeddedDocument(f),C=t.getScanner(f);if(_&&C){let T=yield _.getTemplateData(),E=new Set([...T.components,...T.components.map(Mo.hyphenate).filter(P=>!(0,Z1t.isIntrinsicElement)(a,P))]),S=m?{start:f.offsetAt(m.start),end:f.offsetAt(m.end)}:{start:0,end:f.getText().length},A=C.scan();for(;A!==Xx.TokenType.EOS;){let P=C.getTokenOffset();if(P>S.end)break;if(P>=S.start&&(A===Xx.TokenType.StartTag||A===Xx.TokenType.EndTag)){let I=C.getTokenText();if(E.has(I)||I.indexOf(".")>=0){let N=C.getTokenLength(),B=f.positionAt(P);E.has(I)&&g.push([B.line,B.character,N,(b=s.get("componentTag"))!==null&&b!==void 0?b:-1,0])}}A=C.scan()}}return g})},resolveEmbeddedRange(f){if(i.has(f.start)&&i.has(f.end))return f}});function o(f,m){var v,w;return rp(this,void 0,void 0,function*(){let x=m.tsItem;if(!x)return f;x=yield t.tsLs.doCompletionResolve(x),f.tags=[...(v=f.tags)!==null&&v!==void 0?v:[],...(w=x.tags)!==null&&w!==void 0?w:[]];let b=[],g=[];return f.detail&&b.push(f.detail),x.detail&&b.push(x.detail),b.length&&(f.detail=b.join(`
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

TypeError: (0 , Z1t.isIntrinsicElement) is not a function
    at /home/djfhe/.vscode/extensions/vue.volar-0.38.0-linux-x64/dist/node/server.js:1257:12239
    at Array.filter (<anonymous>)
    at Object.<anonymous> (/home/djfhe/.vscode/extensions/vue.volar-0.38.0-linux-x64/dist/node/server.js:1257:12202)
    at Generator.next (<anonymous>)
    at o (/home/djfhe/.vscode/extensions/vue.volar-0.38.0-linux-x64/dist/node/server.js:1257:8714)
[Info  - 1:14:49 AM] Connection to server got closed. Server will restart.
[Error - 1:14:53 AM] Request textDocument/codeLens failed.
  Message: Request textDocument/codeLens failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
[Error - 1:14:53 AM] Request textDocument/semanticTokens/range failed.
  Message: Request textDocument/semanticTokens/range failed with message: (0 , Z1t.isIntrinsicElement) is not a function
  Code: -32603 
/home/djfhe/.vscode/extensions/vue.volar-0.38.0-linux-x64/dist/node/server.js:1257
@djfhe djfhe changed the title v0.38.0 leading to a lot of errors v0.38.0 is throwing a lot of errors Jun 18, 2022
@madmansn0w
Copy link

Confirmed - running the same setup with same errors.

@Ttou
Copy link

Ttou commented Jun 19, 2022

same problem

@buffet-time
Copy link

Same

@Banana-energy
Copy link

same

1 similar comment
@wobsoriano
Copy link

same

@johnsoncodehk
Copy link
Member

Fixed by c229821

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants