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

🐛 BUG: panic if a jsx attribute is missing an closing quote #623

Closed
JoshuaKGoldberg opened this issue Aug 10, 2023 · 4 comments · Fixed by #717
Closed

🐛 BUG: panic if a jsx attribute is missing an closing quote #623

JoshuaKGoldberg opened this issue Aug 10, 2023 · 4 comments · Fixed by #717
Labels
- P4: important Violate documented behavior or significantly improves performance (priority) ecosystem: compiler Issue is caused by a bug in the Astro compiler

Comments

@JoshuaKGoldberg
Copy link

Describe the Bug

Putting this in a file causes the Astro Language Server to repeatedly crash:

<main id="gotcha />

The Astro Language Server log contains:

panic: runtime error: slice bounds out of range [:21] with length 20

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d678, 0x4fea00, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d970, 0x4fe780, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x486348, 0x14}, 0x4fe780, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x64c180}, {0x42c2c0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
/Users/josh/.vscode/extensions/astro-build.astro-vscode-2.1.4-darwin-arm64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1

Steps to Reproduce

  1. Create and save a .astro file
  2. Add code like <main id="gotcha />

Note that I'm on v2.1.4. This seems to be similar to #518.

@Princesseuh
Copy link
Member

cc @natemoo-re, it's rare we have crashes in the AST parsing, so I didn't think to handle them in the language-server

Thank you for reporting this issue!

@JoshuaKGoldberg
Copy link
Author

Panic! At The Parsing 🎶

@leancept
Copy link

I had the exact same issue. Git-bisected my commit log to find the offending code. More helpful error messages would be much appreciated!

@SelfMadeSystem
Copy link

I'm getting the same issue. Here's the log:

Log
panic: runtime error: slice bounds out of range [:2345] with length 2344

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x4d7b00, 0x4d6f08, 0x4a5180, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x4d7b00, 0x4d72c0, 0x4a4280, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x4d7b00, 0x4d7678, 0x737cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x4d7b00, 0x4d7970, 0x737900, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x5bea80, 0x928}, 0x737900, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x742b80}, {0x42c0e0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
panic: runtime error: slice bounds out of range [:2345] with length 2344

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44cf08, 0x4a5900, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d2c0, 0x4a4a00, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d678, 0x4a4780, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d970, 0x4a43c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x4baa80, 0x928}, 0x4a43c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x410cb0}, {0x42c0c0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
panic: runtime error: slice bounds out of range [:2345] with length 2344

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44cf08, 0x4a7900, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d2c0, 0x4a6a00, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d678, 0x4a6780, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d970, 0x4a63c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x4bca80, 0x928}, 0x4a63c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x410cb0}, {0x42c0c0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
panic: runtime error: slice bounds out of range [:2345] with length 2344

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44cf08, 0x4a5900, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d2c0, 0x4a4a00, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d678, 0x4a4780, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x44db00, 0x44d970, 0x4a43c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x4baa80, 0x928}, 0x4a43c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x410cb0}, {0x42c0c0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1
"use strict";var P=Object.create;var y=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var O=(i,n)=>{for(var s in n)y(i,s,{get:n[s],enumerable:!0})},T=(i,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of A(n))!C.call(i,c)&&c!==s&&y(i,c,{get:()=>n[c],enumerable:!(r=I(n,c))||r.enumerable});return i};var x=(i,n,s)=>(s=i!=null?P(E(i)):{},T(n||!i||!i.__esModule?y(s,"default",{value:i,enumerable:!0}):s,i)),D=i=>T(y({},"__esModule",{value:!0}),i);var M={};O(M,{convertToTSX:()=>W,parse:()=>L,startRunningService:()=>R,transform:()=>N});module.exports=D(M);var k=()=>typeof document>"u"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,w=k();var S=require("fs"),j=require("url");var v=x(require("crypto"),1),b=x(require("fs"),1),_=require("util");globalThis.fs||Object.defineProperty(globalThis,"fs",{value:b.default});globalThis.process||Object.defineProperties(globalThis,"process",{value:process});globalThis.crypto||Object.defineProperty(globalThis,"crypto",{value:v.default.webcrypto?v.default.webcrypto:{getRandomValues(i){return v.default.randomFillSync(i)}}});globalThis.performance||Object.defineProperty(globalThis,"performance",{value:{now(){let[i,n]=process.hrtime();return i*1e3+n/1e6}}});var U=new _.TextEncoder("utf-8"),V=new _.TextDecoder("utf-8");var d=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let n=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},s=e=>{let t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},r=e=>{let t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;let o=this.mem.getUint32(e,!0);return this._values[o]},c=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,a,!0)},l=e=>{let t=s(e+0),o=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},g=e=>{let t=s(e+0),o=s(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=r(t+m*8);return a},h=e=>{let t=s(e+0),o=s(e+8);return V.decode(new DataView(this._inst.exports.mem.buffer,t,o))},u=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;let t=s(e+8),o=s(e+16),a=this.mem.getInt32(e+24,!0);b.default.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,n(e+8,(u+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;let t=new Date().getTime();n(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;let t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,globalThis.crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;let t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){let o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,c(e+24,h(e+8))},"syscall/js.valueGet":e=>{e>>>=0;let t=Reflect.get(r(e+8),h(e+16));e=this._inst.exports.getsp()>>>0,c(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(r(e+8),h(e+16),r(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(r(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,c(e+24,Reflect.get(r(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(r(e+8),s(e+16),r(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{let t=r(e+8),o=Reflect.get(t,h(e+16)),a=g(e+32),m=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,c(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,n(e+16,parseInt(r(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;let t=U.encode(String(r(e+8)));c(e+16,t),n(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;let t=r(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,r(e+8)instanceof r(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;let t=l(e+8),o=r(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;let t=r(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(n){if(!(n instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=n,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let s=4096,r=u=>{let e=s,t=U.encode(u+"\0");return new Uint8Array(this.mem.buffer,s,t.length).set(t),s+=t.length,s%8!==0&&(s+=8-s%8),e},c=this.argv.length,l=[];this.argv.forEach(u=>{l.push(r(u))}),l.push(0),Object.keys(this.env).sort().forEach(u=>{l.push(r(`${u}=${this.env[u]}`))}),l.push(0);let h=s;l.forEach(u=>{this.mem.setUint32(s,u,!0),this.mem.setUint32(s+4,0,!0),s+=8}),this._inst.exports.run(c,h),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(n){let s=this;return function(){let r={id:n,this:this,args:arguments};return s._pendingEvent=r,s._resume(),r.result}}};function p(){return f||(f=R()),f}var f,N=(i,n)=>p().transform(i,n),L=(i,n)=>p().parse(i,n),W=(i,n)=>p().convertToTSX(i,n);function R(){let i=new d,n=F((0,j.fileURLToPath)(new URL("../astro.wasm",w)),i.importObject);i.run(n);let s=globalThis["@astrojs/compiler"];return{transform:(r,c)=>{try{return s.transform(r,c||{})}catch(l){throw f=void 0,l}},parse:(r,c)=>{try{let l=s.parse(r,c||{});return{...l,ast:JSON.parse(l.ast)}}catch(l){throw f=void 0,l}},convertToTSX:(r,c)=>{try{let l=s.convertToTSX(r,c||{});return{...l,map:JSON.parse(l.map)}}catch(l){throw f=void 0,l}}}}function F(i,n){let s=(0,S.readFileSync)(i);return new WebAssembly.Instance(new WebAssembly.Module(s),n)}0&&(module.exports={convertToTSX,parse,startRunningService,transform});
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

TypeError: Cannot read properties of undefined (reading 'ast')
    at Object.parse (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7893)
    at L (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7556)
    at gQ (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:646:2339)
    at Eg.onSnapshotUpdated (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10994)
    at Eg.update (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10776)
    at Object.updateVirtualFile (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:9663)
    at Object.updateSource (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:6325)
    at s (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8512)
    at Object.get (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8282)
    at Object.getMapsByVirtualFileName (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:18756)
[Info  - 13:58:25] Connection to server got closed. Server will restart.
true
panic: runtime error: slice bounds out of range [:2345] with length 2344

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x55db00, 0x55cf08, 0x64d2c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x55db00, 0x55d2c0, 0x64c3c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x55db00, 0x55d678, 0x64c140, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x55db00, 0x55d970, 0x637cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x5e3500, 0x928}, 0x637cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x5ebc00}, {0x42c2e0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1
"use strict";var P=Object.create;var y=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var O=(i,n)=>{for(var s in n)y(i,s,{get:n[s],enumerable:!0})},T=(i,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of A(n))!C.call(i,c)&&c!==s&&y(i,c,{get:()=>n[c],enumerable:!(r=I(n,c))||r.enumerable});return i};var x=(i,n,s)=>(s=i!=null?P(E(i)):{},T(n||!i||!i.__esModule?y(s,"default",{value:i,enumerable:!0}):s,i)),D=i=>T(y({},"__esModule",{value:!0}),i);var M={};O(M,{convertToTSX:()=>W,parse:()=>L,startRunningService:()=>R,transform:()=>N});module.exports=D(M);var k=()=>typeof document>"u"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,w=k();var S=require("fs"),j=require("url");var v=x(require("crypto"),1),b=x(require("fs"),1),_=require("util");globalThis.fs||Object.defineProperty(globalThis,"fs",{value:b.default});globalThis.process||Object.defineProperties(globalThis,"process",{value:process});globalThis.crypto||Object.defineProperty(globalThis,"crypto",{value:v.default.webcrypto?v.default.webcrypto:{getRandomValues(i){return v.default.randomFillSync(i)}}});globalThis.performance||Object.defineProperty(globalThis,"performance",{value:{now(){let[i,n]=process.hrtime();return i*1e3+n/1e6}}});var U=new _.TextEncoder("utf-8"),V=new _.TextDecoder("utf-8");var d=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let n=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},s=e=>{let t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},r=e=>{let t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;let o=this.mem.getUint32(e,!0);return this._values[o]},c=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,a,!0)},l=e=>{let t=s(e+0),o=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},g=e=>{let t=s(e+0),o=s(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=r(t+m*8);return a},h=e=>{let t=s(e+0),o=s(e+8);return V.decode(new DataView(this._inst.exports.mem.buffer,t,o))},u=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;let t=s(e+8),o=s(e+16),a=this.mem.getInt32(e+24,!0);b.default.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,n(e+8,(u+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;let t=new Date().getTime();n(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;let t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,globalThis.crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;let t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){let o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,c(e+24,h(e+8))},"syscall/js.valueGet":e=>{e>>>=0;let t=Reflect.get(r(e+8),h(e+16));e=this._inst.exports.getsp()>>>0,c(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(r(e+8),h(e+16),r(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(r(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,c(e+24,Reflect.get(r(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(r(e+8),s(e+16),r(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{let t=r(e+8),o=Reflect.get(t,h(e+16)),a=g(e+32),m=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,c(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,n(e+16,parseInt(r(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;let t=U.encode(String(r(e+8)));c(e+16,t),n(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;let t=r(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,r(e+8)instanceof r(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;let t=l(e+8),o=r(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;let t=r(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(n){if(!(n instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=n,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let s=4096,r=u=>{let e=s,t=U.encode(u+"\0");return new Uint8Array(this.mem.buffer,s,t.length).set(t),s+=t.length,s%8!==0&&(s+=8-s%8),e},c=this.argv.length,l=[];this.argv.forEach(u=>{l.push(r(u))}),l.push(0),Object.keys(this.env).sort().forEach(u=>{l.push(r(`${u}=${this.env[u]}`))}),l.push(0);let h=s;l.forEach(u=>{this.mem.setUint32(s,u,!0),this.mem.setUint32(s+4,0,!0),s+=8}),this._inst.exports.run(c,h),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(n){let s=this;return function(){let r={id:n,this:this,args:arguments};return s._pendingEvent=r,s._resume(),r.result}}};function p(){return f||(f=R()),f}var f,N=(i,n)=>p().transform(i,n),L=(i,n)=>p().parse(i,n),W=(i,n)=>p().convertToTSX(i,n);function R(){let i=new d,n=F((0,j.fileURLToPath)(new URL("../astro.wasm",w)),i.importObject);i.run(n);let s=globalThis["@astrojs/compiler"];return{transform:(r,c)=>{try{return s.transform(r,c||{})}catch(l){throw f=void 0,l}},parse:(r,c)=>{try{let l=s.parse(r,c||{});return{...l,ast:JSON.parse(l.ast)}}catch(l){throw f=void 0,l}},convertToTSX:(r,c)=>{try{let l=s.convertToTSX(r,c||{});return{...l,map:JSON.parse(l.map)}}catch(l){throw f=void 0,l}}}}function F(i,n){let s=(0,S.readFileSync)(i);return new WebAssembly.Instance(new WebAssembly.Module(s),n)}0&&(module.exports={convertToTSX,parse,startRunningService,transform});
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

TypeError: Cannot read properties of undefined (reading 'ast')
    at Object.parse (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7893)
    at L (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7556)
    at gQ (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:646:2339)
    at Eg.onSnapshotUpdated (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10994)
    at new Eg (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10631)
    at Object.createVirtualFile (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:9623)
    at Object.updateSource (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:6390)
    at s (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8512)
    at Object.get (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8282)
    at d (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:77:34045)
[Info  - 13:58:26] Connection to server got closed. Server will restart.
true
panic: runtime error: slice bounds out of range [:2345] with length 2344

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55af08, 0x64d2c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b2c0, 0x64c3c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b678, 0x64c140, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b970, 0x637cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x5e3500, 0x928}, 0x637cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x5ebc00}, {0x42c2e0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1
"use strict";var P=Object.create;var y=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var O=(i,n)=>{for(var s in n)y(i,s,{get:n[s],enumerable:!0})},T=(i,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of A(n))!C.call(i,c)&&c!==s&&y(i,c,{get:()=>n[c],enumerable:!(r=I(n,c))||r.enumerable});return i};var x=(i,n,s)=>(s=i!=null?P(E(i)):{},T(n||!i||!i.__esModule?y(s,"default",{value:i,enumerable:!0}):s,i)),D=i=>T(y({},"__esModule",{value:!0}),i);var M={};O(M,{convertToTSX:()=>W,parse:()=>L,startRunningService:()=>R,transform:()=>N});module.exports=D(M);var k=()=>typeof document>"u"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,w=k();var S=require("fs"),j=require("url");var v=x(require("crypto"),1),b=x(require("fs"),1),_=require("util");globalThis.fs||Object.defineProperty(globalThis,"fs",{value:b.default});globalThis.process||Object.defineProperties(globalThis,"process",{value:process});globalThis.crypto||Object.defineProperty(globalThis,"crypto",{value:v.default.webcrypto?v.default.webcrypto:{getRandomValues(i){return v.default.randomFillSync(i)}}});globalThis.performance||Object.defineProperty(globalThis,"performance",{value:{now(){let[i,n]=process.hrtime();return i*1e3+n/1e6}}});var U=new _.TextEncoder("utf-8"),V=new _.TextDecoder("utf-8");var d=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let n=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},s=e=>{let t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},r=e=>{let t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;let o=this.mem.getUint32(e,!0);return this._values[o]},c=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,a,!0)},l=e=>{let t=s(e+0),o=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},g=e=>{let t=s(e+0),o=s(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=r(t+m*8);return a},h=e=>{let t=s(e+0),o=s(e+8);return V.decode(new DataView(this._inst.exports.mem.buffer,t,o))},u=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;let t=s(e+8),o=s(e+16),a=this.mem.getInt32(e+24,!0);b.default.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,n(e+8,(u+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;let t=new Date().getTime();n(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;let t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,globalThis.crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;let t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){let o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,c(e+24,h(e+8))},"syscall/js.valueGet":e=>{e>>>=0;let t=Reflect.get(r(e+8),h(e+16));e=this._inst.exports.getsp()>>>0,c(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(r(e+8),h(e+16),r(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(r(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,c(e+24,Reflect.get(r(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(r(e+8),s(e+16),r(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{let t=r(e+8),o=Reflect.get(t,h(e+16)),a=g(e+32),m=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,c(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,n(e+16,parseInt(r(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;let t=U.encode(String(r(e+8)));c(e+16,t),n(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;let t=r(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,r(e+8)instanceof r(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;let t=l(e+8),o=r(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;let t=r(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(n){if(!(n instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=n,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let s=4096,r=u=>{let e=s,t=U.encode(u+"\0");return new Uint8Array(this.mem.buffer,s,t.length).set(t),s+=t.length,s%8!==0&&(s+=8-s%8),e},c=this.argv.length,l=[];this.argv.forEach(u=>{l.push(r(u))}),l.push(0),Object.keys(this.env).sort().forEach(u=>{l.push(r(`${u}=${this.env[u]}`))}),l.push(0);let h=s;l.forEach(u=>{this.mem.setUint32(s,u,!0),this.mem.setUint32(s+4,0,!0),s+=8}),this._inst.exports.run(c,h),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(n){let s=this;return function(){let r={id:n,this:this,args:arguments};return s._pendingEvent=r,s._resume(),r.result}}};function p(){return f||(f=R()),f}var f,N=(i,n)=>p().transform(i,n),L=(i,n)=>p().parse(i,n),W=(i,n)=>p().convertToTSX(i,n);function R(){let i=new d,n=F((0,j.fileURLToPath)(new URL("../astro.wasm",w)),i.importObject);i.run(n);let s=globalThis["@astrojs/compiler"];return{transform:(r,c)=>{try{return s.transform(r,c||{})}catch(l){throw f=void 0,l}},parse:(r,c)=>{try{let l=s.parse(r,c||{});return{...l,ast:JSON.parse(l.ast)}}catch(l){throw f=void 0,l}},convertToTSX:(r,c)=>{try{let l=s.convertToTSX(r,c||{});return{...l,map:JSON.parse(l.map)}}catch(l){throw f=void 0,l}}}}function F(i,n){let s=(0,S.readFileSync)(i);return new WebAssembly.Instance(new WebAssembly.Module(s),n)}0&&(module.exports={convertToTSX,parse,startRunningService,transform});
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

TypeError: Cannot read properties of undefined (reading 'ast')
    at Object.parse (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7893)
    at L (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7556)
    at gQ (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:646:2339)
    at Eg.onSnapshotUpdated (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10994)
    at new Eg (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10631)
    at Object.createVirtualFile (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:9623)
    at Object.updateSource (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:6390)
    at s (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8512)
    at Object.get (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8282)
    at d (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:77:34045)
[Info  - 13:58:26] Connection to server got closed. Server will restart.
true
panic: runtime error: slice bounds out of range [:2345] with length 2344

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55af08, 0x64d2c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b2c0, 0x64c3c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b678, 0x64c140, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b970, 0x637cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x5e3500, 0x928}, 0x637cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x5ebc00}, {0x42c2e0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1
"use strict";var P=Object.create;var y=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var O=(i,n)=>{for(var s in n)y(i,s,{get:n[s],enumerable:!0})},T=(i,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of A(n))!C.call(i,c)&&c!==s&&y(i,c,{get:()=>n[c],enumerable:!(r=I(n,c))||r.enumerable});return i};var x=(i,n,s)=>(s=i!=null?P(E(i)):{},T(n||!i||!i.__esModule?y(s,"default",{value:i,enumerable:!0}):s,i)),D=i=>T(y({},"__esModule",{value:!0}),i);var M={};O(M,{convertToTSX:()=>W,parse:()=>L,startRunningService:()=>R,transform:()=>N});module.exports=D(M);var k=()=>typeof document>"u"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,w=k();var S=require("fs"),j=require("url");var v=x(require("crypto"),1),b=x(require("fs"),1),_=require("util");globalThis.fs||Object.defineProperty(globalThis,"fs",{value:b.default});globalThis.process||Object.defineProperties(globalThis,"process",{value:process});globalThis.crypto||Object.defineProperty(globalThis,"crypto",{value:v.default.webcrypto?v.default.webcrypto:{getRandomValues(i){return v.default.randomFillSync(i)}}});globalThis.performance||Object.defineProperty(globalThis,"performance",{value:{now(){let[i,n]=process.hrtime();return i*1e3+n/1e6}}});var U=new _.TextEncoder("utf-8"),V=new _.TextDecoder("utf-8");var d=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let n=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},s=e=>{let t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},r=e=>{let t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;let o=this.mem.getUint32(e,!0);return this._values[o]},c=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,a,!0)},l=e=>{let t=s(e+0),o=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},g=e=>{let t=s(e+0),o=s(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=r(t+m*8);return a},h=e=>{let t=s(e+0),o=s(e+8);return V.decode(new DataView(this._inst.exports.mem.buffer,t,o))},u=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;let t=s(e+8),o=s(e+16),a=this.mem.getInt32(e+24,!0);b.default.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,n(e+8,(u+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;let t=new Date().getTime();n(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;let t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,globalThis.crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;let t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){let o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,c(e+24,h(e+8))},"syscall/js.valueGet":e=>{e>>>=0;let t=Reflect.get(r(e+8),h(e+16));e=this._inst.exports.getsp()>>>0,c(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(r(e+8),h(e+16),r(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(r(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,c(e+24,Reflect.get(r(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(r(e+8),s(e+16),r(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{let t=r(e+8),o=Reflect.get(t,h(e+16)),a=g(e+32),m=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,c(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,n(e+16,parseInt(r(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;let t=U.encode(String(r(e+8)));c(e+16,t),n(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;let t=r(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,r(e+8)instanceof r(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;let t=l(e+8),o=r(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;let t=r(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(n){if(!(n instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=n,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let s=4096,r=u=>{let e=s,t=U.encode(u+"\0");return new Uint8Array(this.mem.buffer,s,t.length).set(t),s+=t.length,s%8!==0&&(s+=8-s%8),e},c=this.argv.length,l=[];this.argv.forEach(u=>{l.push(r(u))}),l.push(0),Object.keys(this.env).sort().forEach(u=>{l.push(r(`${u}=${this.env[u]}`))}),l.push(0);let h=s;l.forEach(u=>{this.mem.setUint32(s,u,!0),this.mem.setUint32(s+4,0,!0),s+=8}),this._inst.exports.run(c,h),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(n){let s=this;return function(){let r={id:n,this:this,args:arguments};return s._pendingEvent=r,s._resume(),r.result}}};function p(){return f||(f=R()),f}var f,N=(i,n)=>p().transform(i,n),L=(i,n)=>p().parse(i,n),W=(i,n)=>p().convertToTSX(i,n);function R(){let i=new d,n=F((0,j.fileURLToPath)(new URL("../astro.wasm",w)),i.importObject);i.run(n);let s=globalThis["@astrojs/compiler"];return{transform:(r,c)=>{try{return s.transform(r,c||{})}catch(l){throw f=void 0,l}},parse:(r,c)=>{try{let l=s.parse(r,c||{});return{...l,ast:JSON.parse(l.ast)}}catch(l){throw f=void 0,l}},convertToTSX:(r,c)=>{try{let l=s.convertToTSX(r,c||{});return{...l,map:JSON.parse(l.map)}}catch(l){throw f=void 0,l}}}}function F(i,n){let s=(0,S.readFileSync)(i);return new WebAssembly.Instance(new WebAssembly.Module(s),n)}0&&(module.exports={convertToTSX,parse,startRunningService,transform});
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

TypeError: Cannot read properties of undefined (reading 'ast')
    at Object.parse (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7893)
    at L (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7556)
    at gQ (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:646:2339)
    at Eg.onSnapshotUpdated (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10994)
    at new Eg (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10631)
    at Object.createVirtualFile (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:9623)
    at Object.updateSource (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:6390)
    at s (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8512)
    at Object.get (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8282)
    at d (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:77:34045)
[Info  - 13:58:27] Connection to server got closed. Server will restart.
true
panic: runtime error: slice bounds out of range [:2345] with length 2344

goroutine 6 [running]:
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55af08, 0x64d2c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:243 +0x69
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b2c0, 0x64c3c0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b678, 0x64c140, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.renderNode(0x55bb00, 0x55b970, 0x637cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:267 +0x4b
github.com/withastro/compiler/internal/printer.PrintToJSON({0x5e3500, 0x928}, 0x637cc0, {{0x39dd1, 0x7}, 0x1})
	github.com/withastro/compiler/internal/printer/print-to-json.go:114 +0xc
main.Parse.func1({{}, 0x7ff800010000000d, 0x5ebc00}, {0x42c2e0, 0x2, 0x2})
	./astro-wasm.go:219 +0x2b
syscall/js.handleEvent()
	syscall/js/func.go:94 +0x26
exit code: 2
/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1
"use strict";var P=Object.create;var y=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var O=(i,n)=>{for(var s in n)y(i,s,{get:n[s],enumerable:!0})},T=(i,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of A(n))!C.call(i,c)&&c!==s&&y(i,c,{get:()=>n[c],enumerable:!(r=I(n,c))||r.enumerable});return i};var x=(i,n,s)=>(s=i!=null?P(E(i)):{},T(n||!i||!i.__esModule?y(s,"default",{value:i,enumerable:!0}):s,i)),D=i=>T(y({},"__esModule",{value:!0}),i);var M={};O(M,{convertToTSX:()=>W,parse:()=>L,startRunningService:()=>R,transform:()=>N});module.exports=D(M);var k=()=>typeof document>"u"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,w=k();var S=require("fs"),j=require("url");var v=x(require("crypto"),1),b=x(require("fs"),1),_=require("util");globalThis.fs||Object.defineProperty(globalThis,"fs",{value:b.default});globalThis.process||Object.defineProperties(globalThis,"process",{value:process});globalThis.crypto||Object.defineProperty(globalThis,"crypto",{value:v.default.webcrypto?v.default.webcrypto:{getRandomValues(i){return v.default.randomFillSync(i)}}});globalThis.performance||Object.defineProperty(globalThis,"performance",{value:{now(){let[i,n]=process.hrtime();return i*1e3+n/1e6}}});var U=new _.TextEncoder("utf-8"),V=new _.TextDecoder("utf-8");var d=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let n=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},s=e=>{let t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},r=e=>{let t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;let o=this.mem.getUint32(e,!0);return this._values[o]},c=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,a,!0)},l=e=>{let t=s(e+0),o=s(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},g=e=>{let t=s(e+0),o=s(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=r(t+m*8);return a},h=e=>{let t=s(e+0),o=s(e+8);return V.decode(new DataView(this._inst.exports.mem.buffer,t,o))},u=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;let t=s(e+8),o=s(e+16),a=this.mem.getInt32(e+24,!0);b.default.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,n(e+8,(u+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;let t=new Date().getTime();n(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;let t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;let t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,globalThis.crypto.getRandomValues(l(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;let t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){let o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,c(e+24,h(e+8))},"syscall/js.valueGet":e=>{e>>>=0;let t=Reflect.get(r(e+8),h(e+16));e=this._inst.exports.getsp()>>>0,c(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(r(e+8),h(e+16),r(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(r(e+8),h(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,c(e+24,Reflect.get(r(e+8),s(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(r(e+8),s(e+16),r(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{let t=r(e+8),o=Reflect.get(t,h(e+16)),a=g(e+32),m=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,c(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{let t=r(e+8),o=g(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,c(e+40,a),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,c(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,n(e+16,parseInt(r(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;let t=U.encode(String(r(e+8)));c(e+16,t),n(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;let t=r(e+8);l(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,r(e+8)instanceof r(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;let t=l(e+8),o=r(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;let t=r(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}let a=o.subarray(0,t.length);t.set(a),n(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(n){if(!(n instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=n,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let s=4096,r=u=>{let e=s,t=U.encode(u+"\0");return new Uint8Array(this.mem.buffer,s,t.length).set(t),s+=t.length,s%8!==0&&(s+=8-s%8),e},c=this.argv.length,l=[];this.argv.forEach(u=>{l.push(r(u))}),l.push(0),Object.keys(this.env).sort().forEach(u=>{l.push(r(`${u}=${this.env[u]}`))}),l.push(0);let h=s;l.forEach(u=>{this.mem.setUint32(s,u,!0),this.mem.setUint32(s+4,0,!0),s+=8}),this._inst.exports.run(c,h),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(n){let s=this;return function(){let r={id:n,this:this,args:arguments};return s._pendingEvent=r,s._resume(),r.result}}};function p(){return f||(f=R()),f}var f,N=(i,n)=>p().transform(i,n),L=(i,n)=>p().parse(i,n),W=(i,n)=>p().convertToTSX(i,n);function R(){let i=new d,n=F((0,j.fileURLToPath)(new URL("../astro.wasm",w)),i.importObject);i.run(n);let s=globalThis["@astrojs/compiler"];return{transform:(r,c)=>{try{return s.transform(r,c||{})}catch(l){throw f=void 0,l}},parse:(r,c)=>{try{let l=s.parse(r,c||{});return{...l,ast:JSON.parse(l.ast)}}catch(l){throw f=void 0,l}},convertToTSX:(r,c)=>{try{let l=s.convertToTSX(r,c||{});return{...l,map:JSON.parse(l.map)}}catch(l){throw f=void 0,l}}}}function F(i,n){let s=(0,S.readFileSync)(i);return new WebAssembly.Instance(new WebAssembly.Module(s),n)}0&&(module.exports={convertToTSX,parse,startRunningService,transform});
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

TypeError: Cannot read properties of undefined (reading 'ast')
    at Object.parse (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7893)
    at L (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/node_modules/@astrojs/compiler/dist/node/sync.cjs:1:7556)
    at gQ (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:646:2339)
    at Eg.onSnapshotUpdated (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10994)
    at new Eg (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:10631)
    at Object.createVirtualFile (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:647:9623)
    at Object.updateSource (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:6390)
    at s (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8512)
    at Object.get (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:48:8282)
    at d (/home/sms/.vscode/extensions/astro-build.astro-vscode-2.3.1-linux-x64/dist/node/server.js:77:34045)
[Error - 13:58:27] The Astro Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Here is video:

output.mp4

@Princesseuh Princesseuh added - P4: important Violate documented behavior or significantly improves performance (priority) and removed bug labels Nov 12, 2023
@Princesseuh Princesseuh added ecosystem: compiler Issue is caused by a bug in the Astro compiler and removed ecosystem: upstream Issue is caused by a bug / missing feature upstream labels Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly improves performance (priority) ecosystem: compiler Issue is caused by a bug in the Astro compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants