Skip to content

Commit 345b107

Browse files
committed
fix(ssr): remove non-compliant "type" from placeholder scripts
1 parent 26cd767 commit 345b107

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/qwik/src/core/render/ssr/render-ssr.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,11 @@ const renderSSRComponent = (
459459
listeners.push(...elCtx.li);
460460
elCtx.$flags$ &= ~HOST_FLAG_NEED_ATTACH_LISTENER;
461461
placeholderCtx.$id$ = getNextIndex(rCtx);
462+
/**
463+
* This is a placeholder for qwik attributes when the component does not have a DOM
464+
* element. We keep it empty, so it can be a script tag without type.
465+
*/
462466
const attributes: Record<string, string> = {
463-
type: 'placeholder',
464467
hidden: '',
465468
'q:id': placeholderCtx.$id$,
466469
};

packages/qwik/src/core/render/ssr/render-ssr.unit.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ test('component useBrowserVisibleTask() without elements', async () => {
12291229
<body>
12301230
<!--qv q:id=0 q:key=sX:-->
12311231
Hola
1232-
<script type="placeholder" hidden q:id="1" on-document:qinit="/runtimeQRL#_[0]\n/runtimeQRL#_[1]"></script>
1232+
<script hidden q:id="1" on-document:qinit="/runtimeQRL#_[0]\n/runtimeQRL#_[1]"></script>
12331233
<!--/qv-->
12341234
</body>
12351235
</html>
@@ -1248,7 +1248,7 @@ test('component useBrowserVisibleTask() inside <head>', async () => {
12481248
<head q:head>
12491249
<!--qv q:id=0 q:key=sX:-->
12501250
Hola
1251-
<script type="placeholder" hidden q:id="1" on-document:qinit="/runtimeQRL#_[0]\n/runtimeQRL#_[1]"></script>
1251+
<script hidden q:id="1" on-document:qinit="/runtimeQRL#_[0]\n/runtimeQRL#_[1]"></script>
12521252
<!--/qv-->
12531253
<!--qv q:id=2 q:key=sX:-->
12541254
<style on-document:qinit="/runtimeQRL#_[0]\n/runtimeQRL#_[1]" q:id="3" q:head></style>

0 commit comments

Comments
 (0)