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

QWIK ERROR occurs when rendering Qwik components directly in MDX #63

Closed
totto2727 opened this issue Feb 25, 2024 · 2 comments
Closed

QWIK ERROR occurs when rendering Qwik components directly in MDX #63

totto2727 opened this issue Feb 25, 2024 · 2 comments

Comments

@totto2727
Copy link

totto2727 commented Feb 25, 2024

Overview

With official MDX extensions in place, deploying Qwik components directly in .mdx causes a QWIK ERROR (see below for details) on the development server. Drawing and building itself is possible, but the development server log is filled with errors, which is inconvenient.

Minimum environment reproduced

https://stackblitz.com/edit/withastro-astro-wyclcm?file=src%2Fpages%2Findex.mdx

Run npm run dev.

Supplementation

  • If you implement the wrapper in a .astro file, the exception will not occur.

Error log

npm run dev

16:24:08 [watch] src/pages/index.mdx
QWIK ERROR Error: Internal assert, this is likely caused by a bug in Qwik: The Qwik Component was not invoked correctly
    at createAndLogError (/home/projects/withastro-astro-wyclcm/node_modules/@builder.io/qwik/core.mjs:113:52)
    at throwErrorAndStop (/home/projects/withastro-astro-wyclcm/node_modules/@builder.io/qwik/core.mjs:59:17)
    at assertNumber (/home/projects/withastro-astro-wyclcm/node_modules/@builder.io/qwik/core.mjs:156:5)
    at Object.QwikComponent (/home/projects/withastro-astro-wyclcm/node_modules/@builder.io/qwik/core.mjs:7291:5)
    at renderJSXVNode (/home/projects/withastro-astro-wyclcm/node_modules/astro/dist/runtime/server/jsx.js:118:41)
    at renderJSX (/home/projects/withastro-astro-wyclcm/node_modules/astro/dist/runtime/server/jsx.js:57:10)
    at renderJSXVNode (/home/projects/withastro-astro-wyclcm/node_modules/astro/dist/runtime/server/jsx.js:112:22)
16:24:08 [200] / 8ms

Related?

#50

@thejackshelton
Copy link
Member

thejackshelton commented Mar 6, 2024

Overview

With official MDX extensions in place, deploying Qwik components directly in .mdx causes a QWIK ERROR (see below for details) on the development server. Drawing and building itself is possible, but the development server log is filled with errors, which is inconvenient.

Minimum environment reproduced

https://stackblitz.com/edit/withastro-astro-wyclcm?file=src%2Fpages%2Findex.mdx

Run npm run dev.

Supplementation

  • If you implement the wrapper in a .astro file, the exception will not occur.

Error log

npm run dev

16:24:08 [watch] src/pages/index.mdx
QWIK ERROR Error: Internal assert, this is likely caused by a bug in Qwik: The Qwik Component was not invoked correctly
    at createAndLogError (/home/projects/withastro-astro-wyclcm/node_modules/@builder.io/qwik/core.mjs:113:52)
    at throwErrorAndStop (/home/projects/withastro-astro-wyclcm/node_modules/@builder.io/qwik/core.mjs:59:17)
    at assertNumber (/home/projects/withastro-astro-wyclcm/node_modules/@builder.io/qwik/core.mjs:156:5)
    at Object.QwikComponent (/home/projects/withastro-astro-wyclcm/node_modules/@builder.io/qwik/core.mjs:7291:5)
    at renderJSXVNode (/home/projects/withastro-astro-wyclcm/node_modules/astro/dist/runtime/server/jsx.js:118:41)
    at renderJSX (/home/projects/withastro-astro-wyclcm/node_modules/astro/dist/runtime/server/jsx.js:57:10)
    at renderJSXVNode (/home/projects/withastro-astro-wyclcm/node_modules/astro/dist/runtime/server/jsx.js:112:22)
16:24:08 [200] / 8ms

Related?

#50

Hey, I have perused this issue a couple of times. For now, a workaround to suppress the error would be wrapping it in an Astro file before using it in the MDX.

Qwik v2 is soon to be released, which includes a major change in Qwik's serialization system and runtime, including a change to the vNodes, as a result I think it might be best to wait and see if this issue rears its head post v2.

If you have any leads let me know! I will have more time to improve the integration further later this week.

@thejackshelton
Copy link
Member

Fixed in Astro v4.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants