withastro / compiler

The Astro compiler. Written in Go. Distributed as WASM.
Other
496 stars 59 forks source link

🐛 BUG: cloudflare page build error after upgrade #252

Closed dephiros closed 2 years ago

dephiros commented 2 years ago

What version of astro are you using?

0.22.13

What package manager are you using?

yarn

What operating system are you using?

Cloudflare pages (NODE 16.13.1)

Describe the Bug

I upgraded Astro recently and run into this issue in cloudflare pages. I attempted to recreate using a initial template but cannot reproduce.


export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.17.linux.amd64';
--
06:58:17.227 | export PATH="/opt/buildhome/.gimme_cache/versions/go1.17.linux.amd64/bin:${PATH}";
06:58:17.227 | go version >&2;
06:58:17.227 |  
06:58:17.229 | export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.17.linux.amd64.env"
06:58:17.233 | go version go1.17 linux/amd64
06:58:17.234 | Installing missing commands
06:58:17.234 | Verify run directory
06:58:17.234 | Executing user command: yarn run build
06:58:17.386 | yarn run v1.22.17
06:58:17.417 | $ astro build
06:58:19.217 | wasm://wasm/00274c5e:1
06:58:19.217 |  
06:58:19.217 |  
06:58:19.217 | RuntimeError: null function or function signature mismatch
06:58:19.217 | at wasm://wasm/00274c5e:wasm-function[293]:0x1354b
06:58:19.217 | at wasm://wasm/00274c5e:wasm-function[300]:0x14272
06:58:19.217 | at Go._resume (file:///opt/buildhome/repo/node_modules/@astrojs/compiler/node/wasm_exec.js:374:28)
06:58:19.217 | at file:///opt/buildhome/repo/node_modules/@astrojs/compiler/node/wasm_exec.js:384:16
06:58:19.217 | at new Promise (<anonymous>)
06:58:19.217 | at syscall/js.valueNew (file:///opt/buildhome/repo/node_modules/@astrojs/compiler/node/wasm_exec.js:274:54)
06:58:19.217 | at wasm://wasm/00274c5e:wasm-function[321]:0x155e3
06:58:19.217 | at wasm://wasm/00274c5e:wasm-function[821]:0x6c104
06:58:19.217 | at wasm://wasm/00274c5e:wasm-function[293]:0x1354b
06:58:19.217 | at wasm://wasm/00274c5e:wasm-function[300]:0x14272
06:58:19.422 | error Command failed with exit code 1.
06:58:19.422 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
06:58:19.431 | Failed: build command exited with code: 1

</pre><div class="c_yq c_c" style="box-sizing: border-box; display: flex; padding: 32px;"><button type="button" class="c_ll c_lm c_ln c_lo c_lp c_lq c_lr c_ls c_lt c_lu c_lv c_lw c_lx c_ly c_ab c_r c_s c_kt c_fg c_eq c_lz c_ma c_mb c_mc c_gh c_gj c_md c_me c_mf c_mg c_mh c_mi c_mj c_mk c_m c_t c_ml c_mm c_mn c_aq c_mo c_mp c_bf c_ig c_em c_ih c_hn c_bl c_bh c_go c_gp c_mq c_mr c_ms c_ff c_fv c_mt" style="box-sizing: border-box; font-size: 14px; font-family: -apple-system, system-ui, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Helvetica Neue&quot;, Arial, sans-serif; border: 0px solid currentcolor; position: relative; align-items: center; -webkit-box-align: center; justify-content: center; -webkit-box-pack: center; text-align: center; cursor: pointer; user-select: none; white-space: nowrap; padding: 8px 16px; margin: 0px 0px 0px auto; line-height: 1.2; font-weight: 400; display: inline-flex; border-radius: 5px; opacity: inherit; pointer-events: auto; transition-property: background-color, border-color, color; transition-duration: 200ms; transition-timing-function: ease; max-width: initial; float: none; background-color: rgb(0, 81, 195); color: rgb(242, 242, 242); width: auto;"><span style="box-sizing: border-box;">Retry deployment</span></button></div></div></div></div></div></main><footer class="c_b c_hk c_hl c_bl c_bh c_hm c_gi c_gj c_gf" style="box-sizing: border-box; background-color: rgb(255, 255, 255); padding: 32px 16px; border-color: rgb(217, 217, 217); border-top-width: 1px; border-top-style: solid; margin-top: 32px; color: rgb(49, 49, 49); font-family: -apple-system, system-ui, &quot;system-ui&quot;, &quot;Segoe UI&quot;, Roboto, Oxygen, Ubuntu, &quot;Helvetica Neue&quot;, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="c_hn c_ho c_c c_hp c_hq" style="box-sizing: border-box; display: flex; margin-left: auto; margin-right: auto; max-width: 64rem; flex-wrap: wrap;"><div class="c_gq c_hr c_hs c_ht" style="box-sizing: border-box; margin-bottom: 16px; width: 204.797px;"><dl class="c_cc c_ff c_hu" style="box-sizing: border-box; list-style: none; margin-left: 0px; font-size: 14px;"><br class="Apple-interchange-newline">

Link to Minimal Reproducible Example

Try to reproduce with a new astro site and no luck :(

boehs commented 2 years ago

cc @natemoo-re, looks like the same compiler issue here

@dephiros, could you try downgrading to 0.22.3 in your package.json?

dephiros commented 2 years ago

@boehs , thank you for your response.

I downgraded astro but run into a different issue:


16:27:58.894 | > @example/blog@0.0.1 build
-- | --
16:27:58.894 | > astro build
16:27:58.894 |  
16:28:01.620 | RuntimeError: Error: Uh oh, the Astro compiler encountered an unrecoverable error!
16:28:01.620 |  
16:28:01.620 | Please open
16:28:01.620 | a GitHub issue using the link below:
16:28:01.620 | https://github.com/withastro/astro/issues/new?labels=compiler&title=%F0%9F%90%9B+BUG%3A+%60%40astrojs%2Fcompiler%60+panic&body=%23%23%23+Describe+the+Bug%0A++++%0A++++%60%40astrojs%2Fcompiler%60+encountered+an+unrecoverable+error+when+compiling+the+following+file.%0A++++%0A++++**src%2Fpages%2Fabout.astro**%0A++++%60%60%60astro%0A++++---%0Aimport+%7B+AUTHORS+%7D+from+%27%40%2Fconstants%27%3B%0Aimport+BaseLayout+from+%22%40%2Flayouts%2FBaseLayout.astro%22%3B%0A%0Aconst+content+%3D+%7B%0A++heroTitle%3A+%22About+us%22%2C%0A++aboutIntro%3A+%22The+two+nerds+who+love+to+travel+and+enjoy+good+food%22%2C%0A++people%3A+%5B%22an%22%2C+%22lyle%22%5D%2C%0A++certifications%3A+%5B%0A++++%7B%0A++++++title%3A+%22Princess+academy%22%2C%0A++++++imageURL%3A+%22https%3A%2F%2Fres.cloudinary.com%2Fdephiros%2Fimage%2Fupload%2Fc_fill%2Cf_auto%2Cq_auto%2Cw_600%2Fv1639926439%2Flyanvoyages%2Fcredentials%2F2021-12-19_princess_commondor_certification_jp0l3x.png%22%2C%0A++++%7D%2C%0A++++%7B%0A++++++title%3A+%22Travel+leaders%22%2C%0A++++++imageURL%3A+%22https%3A%2F%2Fres.cloudinary.com%2Fdephiros%2Fimage%2Fupload%2Fc_fill%2Cf_auto%2Cq_auto%2Cw_400%2Fv1639924637%2Flyanvoyages%2Fcredentials%2Ftravel-leaders-logo_fxjgtz.png%22%2C%0A++++%7D%2C%0A++++%7B%0A++++++title%3A+%22Nexion+travel+group%22%2C%0A++++++imageURL%3A+%22https%3A%2F%2Fres.cloudinary.com%2Fdephiros%2Fimage%2Fupload%2Fc_fill%2Cf_auto%2Cq_auto%2Cw_400%2Fv1639924637%2Flyanvoyages%2Fcredentials%2Fnexion-logo_ad72t0.png%22%2C%0A++++%7D%2C%0A++%5D%0A%7D%0A%0A---%0A%0A%3CBaseLayout%3E%0A%3C%21--+Team--%3E%0A++%3Cdiv+class%3D%22bg-gray-900%22%3E%0A++++%3Cdiv+class%3D%22px-4+py-12+mx-auto+max-w-7xl+sm%3Apx-6+lg%3Apx-8+lg%3Apy-24%22%3E%0A++++++%3Cdiv+class%3D%22space-y-12%22%3E%0A++++++++%3Cdiv+class%3D%22space-y-5+sm%3Aspace-y-4+md%3Amax-w-xl+lg%3Amax-w-3xl+xl%3Amax-w-none%22%3E%0A++++++++++%3Ch2+class%3D%22text-3xl+font-extrabold+tracking-tight+text-white+sm%3Atext-4xl%22%3E%7Bcontent.heroTitle%7D%3C%2Fh2%3E%0A++++++++++%3Cp+class%3D%22text-xl+text-gray-300%22%3E%7Bcontent.aboutIntro%7D%3C%2Fp%3E%0A++++++++%3C%2Fdiv%3E%0A++++++++%3C%21--+List+of+people+--%3E%0A++++++++%3Cul+role%3D%22list%22+class%3D%22space-y-4+sm%3Agrid+sm%3Agrid-cols-2+sm%3Agap-6+sm%3Aspace-y-0+lg%3Agrid-cols-3+lg%3Agap-8%22%3E%0A++++++++++%7Bcontent.people.map%28%28personKey%29+%3D%3E+%28%7Bkey%3A+personKey%2C+...AUTHORS%5BpersonKey%5D%7D%29%29.map%28%28person%29+%3D%3E+%28%0A++++++++++++%3Cli+class%3D%22px-6+py-10+text-center+bg-gray-800+rounded-lg+xl%3Apx-10+xl%3Atext-left%22%3E%0A++++++++++++++%3Cdiv+class%3D%22space-y-6+xl%3Aspace-y-10%22%3E%0A++++++++++++++++%3Cimg+class%3D%22w-40+h-40+mx-auto+rounded-full+xl%3Aw-56+xl%3Ah-56%22+src%3D%7Bperson.iconURL%7D+alt%3D%7Bperson.name%7D%3E%0A++++++++++++++++%3Cdiv+class%3D%22space-y-2+xl%3Aflex+xl%3Aitems-center+xl%3Ajustify-center%22%3E%0A++++++++++++++++++%3Cdiv+class%3D%22space-y-1+text-lg+font-medium+leading-6+text-center%22%3E%0A++++++++++++++++++++%3Ch3+id%3D%7Bperson.key%7D+class%3D%22text-white%22%3E%7Bperson.name%7D%3C%2Fh3%3E%0A++++++++++++++++++++%3Cp+class%3D%22text-indigo-400%22%3E%7Bperson.title%7D%3C%2Fp%3E%0A++++++++++++++++++%3C%2Fdiv%3E%0A%0A++++++++++++++++++%3Cul+role%3D%22list%22+class%3D%22flex+justify-center+space-x-5%22%3E%0A++++++++++++++++++%3C%2Ful%3E%0A++++++++++++++++%3C%2Fdiv%3E%0A++++++++++++++%3C%2Fdiv%3E%0A++++++++++++%3C%2Fli%3E%0A++++++++++%29%29%7D%0A++++++++%3C%2Ful%3E%0A++++++++%3C%21--+end+listpeople...+--%3E%0A++++++%3C%2Fdiv%3E%0A++++%3C%2Fdiv%3E%0A++%3C%2Fdiv%3E%0A%0A++%3Cdiv+class%3D%22bg-white%22%3E%0A++%3Cdiv+class%3D%22flex+justify-center+px-4+py-12+mx-auto+max-w-7xl+sm%3Apx-6+lg%3Apx-8%22%3E%0A++++%3Cdiv+class%3D%22grid+items-center+justify-center+grid-cols-2+gap-8+md%3Agrid-cols-3+lg%3Agrid-cols-3%22%3E%0A++++++%7Bcontent.certifications.map%28%28certification%29+%3D%3E+%28%0A++++++++%3Cdiv+class%3D%22flex+justify-center+col-span-1+md%3Acol-span-2+lg%3Acol-span-1%22%3E%0A++++++++++%3Cimg+class%3D%22h-14%22+src%3D%7Bcertification.imageURL%7D+alt%3D%7Bcertification.title%7D%3E%0A++++++++%3C%2Fdiv%3E%0A++++++%29%29%7D%0A++++%3C%2Fdiv%3E%0A++%3C%2Fdiv%3E%0A%3C%2Fdiv%3E++%0A%0A%3C%2FBaseLayout%3E%0A%0A++++%60%60%60%0A++++
16:28:01.660 | Failed: build command exited with code: 1

Local still build fine though

boehs commented 2 years ago

Local still build fine though

This issue is insanity. Could you try 0.22.1 pretty please?

dephiros commented 2 years ago

I just tried and ran into the same issue :(


13:17:17.663 | > astro build
-- | --
13:17:17.663 |  
13:17:20.000 | RuntimeError: Error: Uh oh, the Astro compiler encountered an unrecoverable error!
13:17:20.000 |  
13:17:20.000 | Please open
13:17:20.000 | a GitHub issue using the link below:
13:17:20.000 | https://github.com/withastro/astro/issues/new?labels=compiler&title=%F0%9F%90%9B+BUG%3A+%60%40astrojs%2Fcompiler%60+panic&body=%23%23%23+Describe+the+Bug%0A++++%0A++++%60%40astrojs%2Fcompiler%60+encountered+an+unrecoverable+error+when+compiling+the+following+file.%0A++++%0A++++**src%2Fpages%2Fabout.astro**%0A++++%60%60%60astro%0A++++---%0Aimport+%7B+AUTHORS+%7D+from+%27%40%2Fconstants%27%3B%0Aimport+BaseLayout+from+%22%40%2Flayouts%2FBaseLayout.astro%22%3B%0A%0Aconst+content+%3D+%7B%0A++heroTitle%3A+%22About+us%22%2C%0A++aboutIntro%3A+%22The+two+nerds+who+love+to+travel+and+enjoy+good+food%22%2C%0A++people%3A+%5B%22an%22%2C+%22lyle%22%5D%2C%0A++certifications%3A+%5B%0A++++%7B%0A++++++title%3A+%22Princess+academy%22%2C%0A++++++imageURL%3A+%22https%3A%2F%2Fres.cloudinary.com%2Fdephiros%2Fimage%2Fupload%2Fc_fill%2Cf_auto%2Cq_auto%2Cw_600%2Fv1639926439%2Flyanvoyages%2Fcredentials%2F2021-12-19_princess_commondor_certification_jp0l3x.png%22%2C%0A++++%7D%2C%0A++++%7B%0A++++++title%3A+%22Travel+leaders%22%2C%0A++++++imageURL%3A+%22https%3A%2F%2Fres.cloudinary.com%2Fdephiros%2Fimage%2Fupload%2Fc_fill%2Cf_auto%2Cq_auto%2Cw_400%2Fv1639924637%2Flyanvoyages%2Fcredentials%2Ftravel-leaders-logo_fxjgtz.png%22%2C%0A++++%7D%2C%0A++++%7B%0A++++++title%3A+%22Nexion+travel+group%22%2C%0A++++++imageURL%3A+%22https%3A%2F%2Fres.cloudinary.com%2Fdephiros%2Fimage%2Fupload%2Fc_fill%2Cf_auto%2Cq_auto%2Cw_400%2Fv1639924637%2Flyanvoyages%2Fcredentials%2Fnexion-logo_ad72t0.png%22%2C%0A++++%7D%2C%0A++%5D%0A%7D%0A%0A---%0A%0A%3CBaseLayout%3E%0A%3C%21--+Team--%3E%0A++%3Cdiv+class%3D%22bg-gray-900%22%3E%0A++++%3Cdiv+class%3D%22px-4+py-12+mx-auto+max-w-7xl+sm%3Apx-6+lg%3Apx-8+lg%3Apy-24%22%3E%0A++++++%3Cdiv+class%3D%22space-y-12%22%3E%0A++++++++%3Cdiv+class%3D%22space-y-5+sm%3Aspace-y-4+md%3Amax-w-xl+lg%3Amax-w-3xl+xl%3Amax-w-none%22%3E%0A++++++++++%3Ch2+class%3D%22text-3xl+font-extrabold+tracking-tight+text-white+sm%3Atext-4xl%22%3E%7Bcontent.heroTitle%7D%3C%2Fh2%3E%0A++++++++++%3Cp+class%3D%22text-xl+text-gray-300%22%3E%7Bcontent.aboutIntro%7D%3C%2Fp%3E%0A++++++++%3C%2Fdiv%3E%0A++++++++%3C%21--+List+of+people+--%3E%0A++++++++%3Cul+role%3D%22list%22+class%3D%22space-y-4+sm%3Agrid+sm%3Agrid-cols-2+sm%3Agap-6+sm%3Aspace-y-0+lg%3Agrid-cols-3+lg%3Agap-8%22%3E%0A++++++++++%7Bcontent.people.map%28%28personKey%29+%3D%3E+%28%7Bkey%3A+personKey%2C+...AUTHORS%5BpersonKey%5D%7D%29%29.map%28%28person%29+%3D%3E+%28%0A++++++++++++%3Cli+class%3D%22px-6+py-10+text-center+bg-gray-800+rounded-lg+xl%3Apx-10+xl%3Atext-left%22%3E%0A++++++++++++++%3Cdiv+class%3D%22space-y-6+xl%3Aspace-y-10%22%3E%0A++++++++++++++++%3Cimg+class%3D%22w-40+h-40+mx-auto+rounded-full+xl%3Aw-56+xl%3Ah-56%22+src%3D%7Bperson.iconURL%7D+alt%3D%7Bperson.name%7D%3E%0A++++++++++++++++%3Cdiv+class%3D%22space-y-2+xl%3Aflex+xl%3Aitems-center+xl%3Ajustify-center%22%3E%0A++++++++++++++++++%3Cdiv+class%3D%22space-y-1+text-lg+font-medium+leading-6+text-center%22%3E%0A++++++++++++++++++++%3Ch3+id%3D%7Bperson.key%7D+class%3D%22text-white%22%3E%7Bperson.name%7D%3C%2Fh3%3E%0A++++++++++++++++++++%3Cp+class%3D%22text-indigo-400%22%3E%7Bperson.title%7D%3C%2Fp%3E%0A++++++++++++++++++%3C%2Fdiv%3E%0A%0A++++++++++++++++++%3Cul+role%3D%22list%22+class%3D%22flex+justify-center+space-x-5%22%3E%0A++++++++++++++++++%3C%2Ful%3E%0A++++++++++++++++%3C%2Fdiv%3E%0A++++++++++++++%3C%2Fdiv%3E%0A++++++++++++%3C%2Fli%3E%0A++++++++++%29%29%7D%0A++++++++%3C%2Ful%3E%0A++++++++%3C%21--+end+listpeople...+--%3E%0A++++++%3C%2Fdiv%3E%0A++++%3C%2Fdiv%3E%0A++%3C%2Fdiv%3E%0A%0A++%3Cdiv+class%3D%22bg-white%22%3E%0A++%3Cdiv+class%3D%22flex+justify-center+px-4+py-12+mx-auto+max-w-7xl+sm%3Apx-6+lg%3Apx-8%22%3E%0A++++%3Cdiv+class%3D%22grid+items-center+justify-center+grid-cols-2+gap-8+md%3Agrid-cols-3+lg%3Agrid-cols-3%22%3E%0A++++++%7Bcontent.certifications.map%28%28certification%29+%3D%3E+%28%0A++++++++%3Cdiv+class%3D%22flex+justify-center+col-span-1+md%3Acol-span-2+lg%3Acol-span-1%22%3E%0A++++++++++%3Cimg+class%3D%22h-14%22+src%3D%7Bcertification.imageURL%7D+alt%3D%7Bcertification.title%7D%3E%0A++++++++%3C%2Fdiv%3E%0A++++++%29%29%7D%0A++++%3C%2Fdiv%3E%0A++%3C%2Fdiv%3E%0A%3C%2Fdiv%3E++%0A%0A%3C%2FBaseLayout%3E%0A%0A++++%60%60%60%0A++++
13:17:20.033 | Failed: build command exited with code: 1
dephiros commented 2 years ago

ok i tested another downgrade to 0.21.13 and the build is successful now!

boehs commented 2 years ago

Incredible, It seems everyone experiencing this bug has their own working versions.

Mine are 0.22.3 and 0.22.1, @dephiros's is 0.21.13. Crazy, cc @natemoo-re again for this new crazy fact


also, while I am at it I wanted to add that sometimes this error also happens (via discord)

wasm://wasm/00273ac2:1

RuntimeError: null function or function signature mismatch
    at wasm://wasm/00273ac2:wasm-function[293]:0x13534
    at wasm://wasm/00273ac2:wasm-function[300]:0x1425b
    at Go._resume (file:///home/evan/.local/share/pnpm-global/5/node_modules/.pnpm/@astrojs+compiler@0.7.4/node_modules/@astrojs/compiler/node/wasm_exec.js:374:28)
    at file:///home/evan/.local/share/pnpm-global/5/node_modules/.pnpm/@astrojs+compiler@0.7.4/node_modules/@astrojs/compiler/node/wasm_exec.js:384:16
    at new Promise (<anonymous>)
    at syscall/js.valueNew (file:///home/evan/.local/share/pnpm-global/5/node_modules/.pnpm/@astrojs+compiler@0.7.4/node_modules/@astrojs/compiler/node/wasm_exec.js:274:54)
    at wasm://wasm/00273ac2:wasm-function[321]:0x155cc
    at wasm://wasm/00273ac2:wasm-function[821]:0x6bc8d
    at wasm://wasm/00273ac2:wasm-function[293]:0x13534
    at wasm://wasm/00273ac2:wasm-function[300]:0x1425b

Node.js v17.3.0
jonathantneal commented 2 years ago

I can’t make out why this error is happening, but I know those error messages (WASM and @astrojs+compiler) and those come from the compiler. Transferring the issue there. If there are similar issues, this may make it easier to knock out duplicates in smaller strokes.

jonathantneal commented 2 years ago

Related post on Discord

I'm getting RuntimeError: null function or function signature mismatch on builds in Netlify, astro 0.22.14 -- not sure if this is something wrong with Netlify or Astro. More details from the log:

8:32:56 AM: > astro build
8:32:59 AM: wasm://wasm/00278716:1
8:32:59 AM: RuntimeError: null function or function signature mismatch
8:32:59 AM:     at wasm://wasm/00278716:wasm-function[293]:0x1354c
8:32:59 AM:     at wasm://wasm/00278716:wasm-function[300]:0x14273
8:32:59 AM:     at Go._resume (file:///opt/build/repo/node_modules/@astrojs/compiler/node/wasm_exec.js:374:28)
8:32:59 AM:     at file:///opt/build/repo/node_modules/@astrojs/compiler/node/wasm_exec.js:384:16
8:32:59 AM:     at new Promise (<anonymous>)
8:32:59 AM:     at syscall/js.valueNew (file:///opt/build/repo/node_modules/@astrojs/compiler/node/wasm_exec.js:274:54)
8:32:59 AM:     at wasm://wasm/00278716:wasm-function[321]:0x155e4
8:32:59 AM:     at wasm://wasm/00278716:wasm-function[821]:0x6c13c
8:32:59 AM:     at wasm://wasm/00278716:wasm-function[293]:0x1354c
8:32:59 AM:     at wasm://wasm/00278716:wasm-function[300]:0x14273
natemoo-re commented 2 years ago

Closing in favor of https://github.com/withastro/compiler/issues/256